luci-base: replace uci change pages with client side modal dialog
[oweals/luci.git] / modules / luci-base / luasrc / view / header.htm
1 <%#
2  Copyright 2008 Steven Barth <steven@midlink.org>
3  Copyright 2008-2019 Jo-Philipp Wich <jo@mein.io>
4  Licensed to the public under the Apache License 2.0.
5 -%>
6
7 <%
8         if not luci.dispatcher.context.template_header_sent then
9                 include("themes/" .. theme .. "/header")
10                 luci.dispatcher.context.template_header_sent = true
11         end
12
13         local applyconf = luci.config and luci.config.apply
14 %>
15
16 <script type="text/javascript" src="<%=resource%>/promis.min.js"></script>
17 <script type="text/javascript" src="<%=resource%>/luci.js"></script>
18 <script type="text/javascript">
19         L = new LuCI(<%= luci.http.write_json({
20                 token          = token,
21                 resource       = resource,
22                 scriptname     = luci.http.getenv("SCRIPT_NAME"),
23                 pathinfo       = luci.http.getenv("PATH_INFO"),
24                 requestpath    = luci.dispatcher.context.requestpath,
25                 pollinterval   = luci.config.main.pollinterval or 5,
26                 sessionid      = luci.dispatcher.context.authsession,
27                 apply_rollback = math.max(applyconf and applyconf.rollback or 30, 30),
28                 apply_holdoff  = math.max(applyconf and applyconf.holdoff or 4, 1),
29                 apply_timeout  = math.max(applyconf and applyconf.timeout or 5, 1),
30                 apply_display  = math.max(applyconf and applyconf.display or 1.5, 1),
31                 rollback_token = rollback_token
32         }) %>);
33 </script>