header.htm 2.5 KB

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