From: YanlanShen Date: Mon, 28 Jan 2019 02:40:15 +0000 (+0800) Subject: luci-theme-rosy: X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bf26a554305627fce3225e0cddfbe6fea1a3a673;p=oweals%2Fluci.git luci-theme-rosy: luasrc: Modify the layout to accommodate style changes Signed-off-by: YanlanShen --- diff --git a/themes/luci-theme-rosy/luasrc/view/themes/rosy/header.htm b/themes/luci-theme-rosy/luasrc/view/themes/rosy/header.htm index a6aafbed6..c10dea9dd 100644 --- a/themes/luci-theme-rosy/luasrc/view/themes/rosy/header.htm +++ b/themes/luci-theme-rosy/luasrc/view/themes/rosy/header.htm @@ -1,4 +1,4 @@ -<%# +<%# Rosy is a theme for LuCI. It is based on luci-theme-bootstrap luci-theme-rosy Copyright 2018 Rosy Song @@ -192,6 +192,26 @@ end end end + + local function auth_level() + local childs = disp.node_childs(cattree) + if #childs > 0 then + for i, r in ipairs(childs) do + local nnode = cattree.nodes[r] + local grandchildren = disp.node_childs(nnode) + + if #grandchildren > 0 then + -- If this value is returned, the current interface is the logged-in data output interface + return "auth" + else + -- If this value is returned, it indicates that the current interface is a data output interface that does not require login. + return "noauth" + end + end + end + -- If this value is returned, the current interface is the login interface + return "login" + end -%> @@ -234,33 +254,33 @@ - + logged-in<%- end %> <%- if auth_level() == "noauth" then %> login-info<%- end %> <%- if auth_level() == "login" then %> login<%- end %>">
-
-
- - <%=boardinfo.hostname or "?"%> -
- <% render_changes() %> - - <% render_logout() %> -
+
+ + <%=boardinfo.hostname or "?"%> +
+ <% render_changes() %> + + <% render_logout() %>
+
+ +
+ +
Loading... +
+
-
-
- -
Loading... -