Translated using Weblate (Japanese)
[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                 media          = media,
22                 resource       = resource,
23                 scriptname     = luci.http.getenv("SCRIPT_NAME"),
24                 pathinfo       = luci.http.getenv("PATH_INFO"),
25                 documentroot   = luci.http.getenv("DOCUMENT_ROOT"),
26                 requestpath    = luci.dispatcher.context.requestpath,
27                 dispatchpath   = luci.dispatcher.context.path,
28                 pollinterval   = luci.config.main.pollinterval or 5,
29                 ubuspath       = luci.config.main.ubuspath or '/ubus/',
30                 sessionid      = luci.dispatcher.context.authsession,
31                 nodespec       = luci.dispatcher.context.dispatched,
32                 apply_rollback = math.max(applyconf and applyconf.rollback or 30, 30),
33                 apply_holdoff  = math.max(applyconf and applyconf.holdoff or 4, 1),
34                 apply_timeout  = math.max(applyconf and applyconf.timeout or 5, 1),
35                 apply_display  = math.max(applyconf and applyconf.display or 1.5, 1),
36                 rollback_token = rollback_token
37         }) %>);
38 </script>