3 local load1, load5, load15 = luci.sys.loadavg()
4 local request = require("luci.dispatcher").context.path
5 local category = request[1]
6 local tree = luci.dispatcher.node()
7 local cattree = category and luci.dispatcher.node(category)
8 local node = luci.dispatcher.context.dispatched
11 for i,r in ipairs(request) do
12 if c.nodes and c.nodes[r] then
14 c._menu_selected = true
18 require("luci.i18n").loadc("default")
20 require("luci.http").prepare_content("text/html")
21 %><?xml version="1.0" encoding="utf-8"?>
22 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
23 <html xmlns="http://www.w3.org/1999/xhtml">
25 <link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" />
26 <% if node and node.css then %><link rel="stylesheet" type="text/css" href="<%=resource%>/<%=node.css%>" /><% end %>
27 <meta http-equiv="content-type" content="text/xhtml+xml; charset=utf-8" />
28 <meta http-equiv="content-script-type" content="text/javascript" />
29 <title>LuCI - Lua Configuration Interface - <%=(node and node.title)%></title>
33 <div class="info whitetext smalltext bold right">
34 <%=luci.config.brand.firmware%><br />
35 <%=luci.config.brand.distro%><br />
36 <%:load%>: <%=load1%> <%=load5%> <%=load15%><br />
37 <%:hostname%>: <%=luci.sys.hostname()%>
40 <span class="headertitle"><%=luci.config.brand.title%></span><br />
41 <span class="whitetext bold"><%=luci.config.brand.subtitle%></span>
45 <div class="pathbar separator black whitetext bold">
48 local url = controller
49 for k,v in pairs(request) do
50 if c.nodes and c.nodes[v] then
53 %><a href="<%=url%>"><%=c.title or v%></a> <% if k ~= #request then %>» <% end
60 <div class="mainmenu">
62 local function submenu(prefix, node)
63 if not node.nodes then
67 for k, n in pairs(node.nodes) do
68 if n.title and n.target then
69 table.insert(index, {name=k, order=n.order or 100})
73 table.sort(index, function(a, b) return a.order < b.order end)
76 <% for j, v in pairs(index) do
77 local nnode = node.nodes[v.name]
78 local href = controller .. prefix .. v.name
79 href = (nnode.query) and href .. luci.http.build_querystring(nnode.query) or href
82 <span<% if nnode._menu_selected then %> class="active"<%end%>><a href="<%=href%>"><%=nnode.title%></a></span>
83 <% submenu(prefix .. v.name .. "/", nnode) %>
90 if cattree and cattree.nodes then
92 for k, node in pairs(cattree.nodes) do
93 table.insert(index, {name=k, order=node.order or 100})
96 table.sort(index, function(a, b) return a.order < b.order end)
98 for i, k in ipairs(index) do
99 node = cattree.nodes[k.name]
100 if node.title and node.target then
101 local href = controller.."/"..category.."/"..k.name
102 href = (k.query) and href .. luci.http.build_querystring(k.query) or href %>
103 <div<% if node._menu_selected then %> class="preactive"<%end%>><a href="<%=href%>"><%=node.title%></a>
104 <%submenu("/" .. category .. "/" .. k.name .. "/", node)%>
111 <div class="modemenu">
113 for k,node in pairs(tree.nodes) do
114 if node.title then %>
115 <li<% if request[1] == k then %> class="active"<%end%>><a href="<%=controller%>/<%=k%>"><%=node.title%></a></li>
122 <div class="sidebar">
124 if "admin" == request[1] then
126 for i, j in pairs(require("luci.model.uci").changes()) do
127 for k, l in pairs(j) do
128 for m, n in pairs(l) do
136 <% if ucic > 0 then %>
137 <li><a href="<%=controller%>/admin/uci/changes"><%:changes%>: <%=ucic%></a></li>
138 <li><a href="<%=controller%>/admin/uci/apply"><%:apply%></a></li>
139 <li><a href="<%=controller%>/admin/uci/revert"><%:revert%></a></li>
141 <li><%:changes%>: 0</li>