From bf26a554305627fce3225e0cddfbe6fea1a3a673 Mon Sep 17 00:00:00 2001 From: YanlanShen Date: Mon, 28 Jan 2019 10:40:15 +0800 Subject: [PATCH] luci-theme-rosy: luasrc: Modify the layout to accommodate style changes Signed-off-by: YanlanShen --- .../luasrc/view/themes/rosy/header.htm | 66 ++++++++++++------- 1 file changed, 43 insertions(+), 23 deletions(-) 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... -