2 Copyright
2008 Steven Barth
<steven@midlink.org
>
3 Copyright
2008-
2016 Jo-Philipp Wich
<jow@openwrt.org
>
4 Copyright
2012 David Menting
<david@nut-bolt.nl
>
5 Licensed to the public under the Apache License
2.0.
9 local sys = require
"luci.sys"
10 local util = require
"luci.util"
11 local http = require
"luci.http"
12 local disp = require
"luci.dispatcher"
14 local boardinfo = util.ubus(
"system",
"board")
16 local node = disp.context.dispatched
20 if theme ==
"bootstrap-dark" then
22 elseif theme ==
"bootstrap-light" then
27 http.prepare_content(
"text/html")
30 <html lang=
"<%=luci.i18n.context.lang%>"<%= ifattr(darkpref ~= nil,
"data-darkmode", darkpref) %
>>
32 <meta charset=
"utf-8">
33 <title><%=striptags( (boardinfo.hostname or
"?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %
> - LuCI
</title>
34 <% if darkpref == nil then %
>
35 <script type=
"text/javascript">
36 var mediaQuery = window.matchMedia('(prefers-color-scheme: dark)'),
37 rootElement = document.querySelector(':root'),
38 setDarkMode = function(match) { rootElement.setAttribute('data-darkmode', match.matches) };
40 mediaQuery.addEventListener('change', setDarkMode);
41 setDarkMode(mediaQuery);
44 <meta name=
"viewport" content=
"initial-scale=1.0">
45 <link rel=
"stylesheet" href=
"<%=media%>/cascade.css">
46 <link rel=
"stylesheet" media=
"only screen and (max-device-width: 854px)" href=
"<%=media%>/mobile.css" type=
"text/css" />
47 <link rel=
"shortcut icon" href=
"<%=media%>/favicon.png">
48 <% if node and node.css then %
>
49 <link rel=
"stylesheet" href=
"<%=resource%>/<%=node.css%>">
52 <style title=
"text/css"><%= css %
></style>
54 <script src=
"<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
55 <script src=
"<%=resource%>/cbi.js"></script>
58 <body class=
"lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><%- end %>" data-page=
"<%= pcdata(table.concat(disp.context.requestpath, "-
")) %>">
59 <% if not blank_page then %
>
61 <a class=
"brand" href=
"/"><%=striptags(boardinfo.hostname or
"?")%
></a>
62 <ul class=
"nav" id=
"topmenu" style=
"display:none"></ul>
63 <div id=
"indicators" class=
"pull-right"></div>
66 <div id=
"maincontent" class=
"container">
67 <%- if luci.sys.process.info(
"uid") ==
0 and luci.sys.user.getuser(
"root") and not luci.sys.user.getpasswd(
"root") then -%
>
68 <div class=
"alert-message warning">
69 <h4><%:No password set!%
></h4>
70 <p><%:There is no password set on this router. Please configure a root password to protect the web interface.%
></p>
71 <% if disp.lookup(
"admin/system/admin") then %
>
72 <div class=
"right"><a class=
"btn" href=
"<%=url("admin/system/admin
")%>"><%:Go to password configuration...%
></a></div>
78 <div class=
"alert-message warning">
79 <h4><%:JavaScript required!%
></h4>
80 <p><%:You must enable JavaScript in your browser or LuCI will not work properly.%
></p>
84 <div id=
"tabmenu" style=
"display:none"></div>