summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/view/header.htm
blob: 9cdedde5c2bc08bfbbf1a922c7e60e6193409c4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<%#
 Copyright 2008 Steven Barth <steven@midlink.org>
 Copyright 2008-2019 Jo-Philipp Wich <jo@mein.io>
 Licensed to the public under the Apache License 2.0.
-%>

<%
	if not luci.dispatcher.context.template_header_sent then
		include("themes/" .. theme .. "/header")
		luci.dispatcher.context.template_header_sent = true
	end

	local applyconf = luci.config and luci.config.apply
%>

<script type="text/javascript" src="<%=resource%>/promis.min.js?v=git-19.292.31773-cc35194"></script>
<script type="text/javascript" src="<%=resource%>/luci.js?v=git-19.292.31773-cc35206"></script>
<script type="text/javascript">
	L = new LuCI(<%= luci.http.write_json({
		token          = token,
		resource       = resource,
		scriptname     = luci.http.getenv("SCRIPT_NAME"),
		pathinfo       = luci.http.getenv("PATH_INFO"),
		requestpath    = luci.dispatcher.context.requestpath,
		dispatchpath   = luci.dispatcher.context.path,
		pollinterval   = luci.config.main.pollinterval or 5,
		sessionid      = luci.dispatcher.context.authsession,
		apply_rollback = math.max(applyconf and applyconf.rollback or 30, 30),
		apply_holdoff  = math.max(applyconf and applyconf.holdoff or 4, 1),
		apply_timeout  = math.max(applyconf and applyconf.timeout or 5, 1),
		apply_display  = math.max(applyconf and applyconf.display or 1.5, 1),
		rollback_token = rollback_token
	}) %>);
</script>