2 Copyright
2020 Jo-Philipp Wich
<jo@mein.io
>
3 Licensed to the public under the Apache License
2.0.
7 local sys = require
"luci.sys"
8 local util = require
"luci.util"
9 local http = require
"luci.http"
10 local disp = require
"luci.dispatcher"
11 local ver = require
"luci.version"
13 local boardinfo = util.ubus(
"system",
"board") or { }
15 local node = disp.context.dispatched
16 local path = table.concat(disp.context.path,
"-")
18 http.prepare_content(
"text/html; charset=UTF-8")
21 <html lang=
"<%=luci.i18n.context.lang%>">
23 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
24 <meta http-equiv=
"Content-Script-Type" content=
"text/javascript" />
25 <meta name=
"viewport" content=
"width=device-width, initial-scale=1" />
26 <link rel=
"stylesheet" type=
"text/css" media=
"screen" href=
"<%=media%>/cascade.css" />
27 <link rel=
"icon" href=
"<%=media%>/favicon.png" type=
"image/svg+xml" />
28 <script type=
"text/javascript" src=
"<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
29 <script type=
"text/javascript" src=
"<%=resource%>/cbi.js"></script>
30 <title><%=striptags( (boardinfo.hostname or
"?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %
> - LuCI
</title>
31 <% if css then %
><style title=
"text/css">
36 <body class=
"lang_<%=luci.i18n.context.lang%>" data-page=
"<%= pcdata(path) %>">
39 <span id=
"skiplink1"><a href=
"#navigation"><%:Skip to navigation%
></a></span>
40 <span id=
"skiplink2"><a href=
"#content"><%:Skip to content%
></a></span>
44 <h2 class=
"navigation"><a id=
"navigation" name=
"navigation"><%:Navigation%
></a></h2>
46 <span class=
"hostname"><a href=
"/"><%=(boardinfo.hostname or
"?")%
></a></span>
47 <span class=
"distversion"><%=ver.distversion%
></span>
48 <span id=
"indicators"></span>
51 <div id=
"modemenu" style=
"display:none"></div>
53 <div id=
"maincontainer">
54 <div id=
"mainmenu"></div>
56 <div id=
"maincontent">
57 <%- if luci.sys.process.info(
"uid") ==
0 and luci.sys.user.getuser(
"root") and not luci.sys.user.getpasswd(
"root") and path ~=
"admin-system-admin-password" then -%
>
58 <div class=
"alert-message warning">
59 <h4><%:No password set!%
></h4>
60 <p><%:There is no password set on this router. Please configure a root password to protect the web interface.%
></p>
61 <% if disp.lookup(
"admin/system/admin") then %
>
62 <div class=
"right"><a class=
"btn" href=
"<%=url("admin/system/admin
")%>"><%:Go to password configuration...%
></a></div>
67 <div id=
"tabmenu" style=
"display:none"></div>