themes: warn if booted from initramfs
[project/luci.git] / themes / luci-theme-openwrt / luasrc / view / themes / openwrt.org / header.htm
1 <%#
2 Copyright 2008 Steven Barth <steven@midlink.org>
3 Copyright 2008-2010 Jo-Philipp Wich <jow@openwrt.org>
4 Licensed to the public under the Apache License 2.0.
5 -%>
6
7 <%
8 local sys = require "luci.sys"
9 local util = require "luci.util"
10 local http = require "luci.http"
11 local disp = require "luci.dispatcher"
12 local ver = require "luci.version"
13
14 local sysinfo = util.ubus("system", "info") or { }
15 local loadinfo = sysinfo.load or { 0, 0, 0 }
16 local boardinfo = util.ubus("system", "board") or { }
17
18 local node = disp.context.dispatched
19
20 http.prepare_content("application/xhtml+xml")
21 -%>
22
23 <?xml version="1.0" encoding="utf-8"?>
24 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
25 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=luci.i18n.context.lang%>" lang="<%=luci.i18n.context.lang%>">
26 <head>
27 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28 <meta name="viewport" content="width=device-width, initial-scale=1" />
29 <meta http-equiv="Content-Script-Type" content="text/javascript" />
30 <link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
31 <% if node and node.css then %><link rel="stylesheet" type="text/css" media="screen" href="<%=resource%>/<%=node.css%>" />
32 <% end -%>
33 <% if css then %><style title="text/css">
34 <%= css %>
35 </style>
36 <% end -%>
37 <script type="text/javascript" src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
38 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
39
40 <title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
41 </head>
42 <body class="lang_<%=luci.i18n.context.lang%>" data-page="<%= pcdata(table.concat(disp.context.requestpath, "-")) %>">
43
44 <p class="skiplink">
45 <span id="skiplink1"><a href="#navigation"><%:Skip to navigation%></a></span>
46 <span id="skiplink2"><a href="#content"><%:Skip to content%></a></span>
47 </p>
48
49 <div id="menubar">
50 <h2 class="navigation"><a id="navigation" name="navigation"><%:Navigation%></a></h2>
51
52 <div class="hostinfo">
53 <%=striptags(boardinfo.hostname or "?")%> | <%=ver.distversion%> |
54 <%:Load%>: <%="%.2f" % (loadinfo[1] / 65535.0)%> <%="%.2f" % (loadinfo[2] / 65535.0)%> <%="%.2f" % (loadinfo[3] / 65535.0)%>
55 </div>
56
57 <div id="indicators"></div>
58
59 <ul id="modemenu" style="display:none"></ul>
60
61 <div class="clear"></div>
62 </div>
63
64 <div id="maincontainer">
65 <div id="mainmenu" style="display:none"></div>
66
67 <div id="maincontent">
68 <div id="tabmenu" style="display:none"></div>
69
70 <noscript>
71 <div class="alert-message warning">
72 <h4><%:JavaScript required!%></h4>
73 <p><%:You must enable JavaScript in your browser or LuCI will not work properly.%></p>
74 </div>
75 </noscript>
76
77 <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
78 <div class="alert-message warning">
79 <h4><%:No password set!%></h4>
80 <p><%:There is no password set on this router. Please configure a root password to protect the web interface.%></p>
81 <% if disp.lookup("admin/system/admin") then %>
82 <div class="right"><a class="btn" href="<%=url("admin/system/admin")%>"><%:Go to password configuration...%></a></div>
83 <% end %>
84 </div>
85 <%- end -%>
86
87 <%- if boardinfo.rootfs_type == "initramfs" then -%>
88 <div class="alert-message warning">
89 <h4><%:System running in recovery (initramfs) mode.%></h4>
90 <p><%:No changes to settings will be stored and are lost after rebooting. This mode should only be used to install a firmware upgrade%></p>
91 <% if disp.lookup("admin/system/flash") then %>
92 <div class="right"><a class="btn" href="<%=url("admin/system/flash")%>"><%:Go to firmware upgrade...%></a></div>
93 <% end %>
94 </div>
95 <%- end -%>