<%# 不同生活(a@lce.cc) -%> <% local sys = require "luci.sys" local util = require "luci.util" local http = require "luci.http" local disp = require "luci.dispatcher" local boardinfo = util.ubus("system", "board") 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 -- send as HTML5 http.prepare_content("text/html") 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 local function subtree(prefix, node, level) if not level then level = 1 end local childs = disp.node_childs(node) if #childs > 0 then if level > 2 then %> <% end if selected_node then subtree(prefix .. selected_name .. "/", selected_node, level + 1) end end end -%> <%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI <% if category then subtree("/" .. category .. "/", cattree) end %>
">
<%- if fuser then %>
<%:Invalid username and/or password! Please try again.%>

<% end -%>
<% local uci = require "luci.model.uci".cursor() local fs = require "nixio.fs" local https_key = uci:get("uhttpd", "main", "key") local https_port = uci:get("uhttpd", "main", "listen_https") if type(https_port) == "table" then https_port = https_port[1] end if https_port and fs.access(https_key) then https_port = https_port:match("(%d+)$") %> <% end %>