<%# LuCI - Lua Configuration Interface Copyright 2008 Steven Barth Copyright 2008-2010 Jo-Philipp Wich Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id: header.htm 7810 2011-10-28 15:15:27Z jow $ Contributors: Simó Albert i Beltran -%> <% package.path = package.path .. ";/etc/qmp/?.lua" local sys = require "luci.sys" local http = require "luci.http" local disp = require "luci.dispatcher" local qmp = require "qmpinfo" local qmpheader = "qMp "..qmp.get_version("branch").." r."..qmp.get_version("revision")..string.sub(qmp.get_version("build"),1,8) local hostname = sys.hostname() local load1, load5, load15 = sys.loadavg() local request = disp.context.path local request2 = disp.context.request local category = request[1] local cattree = category and disp.node(category) local leaf = request2[#request2] local tree = disp.node() local node = disp.context.dispatched local categories = disp.node_childs(tree) local c = tree local i, r -- tag all nodes leading to this page for i, r in ipairs(request) do if c.nodes and c.nodes[r] then c = c.nodes[r] c._menu_selected = true end end http.prepare_content("application/xhtml+xml") local function nodeurl(prefix, name, query) local url = controller .. prefix .. name .. "/" if query then url = url .. http.build_querystring(query) end return pcdata(url) end -%> <% if node and node.css then %> <% end -%> <%=striptags( hostname .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI
<%=hostname%> | <%=qmpheader%> | <%=luci.version.distversion%> | <%:Load%>: <%="%.2f" % load1%> <%="%.2f" % load5%> <%="%.2f" % load15%>
<%- local function submenu(prefix, node) local childs = disp.node_childs(node) if #childs > 0 then %> <% end end %>
<%- if luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
<%:No password set!%>
<%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%>
"><%:Go to password configuration...%>
<%- end -%>