Merge pull request #3458 from janh/vnstat2
[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?v=git-19.292.31773-cc35194"></script>
17 <script type="text/javascript" src="<%=resource%>/luci.js?v=git-19.292.31773-cc35206"></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                 dispatchpath   = luci.dispatcher.context.path,
26                 pollinterval   = luci.config.main.pollinterval or 5,
27                 ubuspath       = luci.config.main.ubuspath or '/ubus',
28                 sessionid      = luci.dispatcher.context.authsession,
29                 apply_rollback = math.max(applyconf and applyconf.rollback or 30, 30),
30                 apply_holdoff  = math.max(applyconf and applyconf.holdoff or 4, 1),
31                 apply_timeout  = math.max(applyconf and applyconf.timeout or 5, 1),
32                 apply_display  = math.max(applyconf and applyconf.display or 1.5, 1),
33                 rollback_token = rollback_token
34         }) %>);
35 </script>