diff options
Diffstat (limited to 'themes/luci-theme-rosy')
-rw-r--r-- | themes/luci-theme-rosy/htdocs/luci-static/rosy/cascade.css | 1 | ||||
-rw-r--r-- | themes/luci-theme-rosy/luasrc/view/themes/rosy/header.htm | 95 |
2 files changed, 36 insertions, 60 deletions
diff --git a/themes/luci-theme-rosy/htdocs/luci-static/rosy/cascade.css b/themes/luci-theme-rosy/htdocs/luci-static/rosy/cascade.css index 26a08be463..d6460532fa 100644 --- a/themes/luci-theme-rosy/htdocs/luci-static/rosy/cascade.css +++ b/themes/luci-theme-rosy/htdocs/luci-static/rosy/cascade.css @@ -1632,6 +1632,7 @@ td > .ifacebadge, .network-status-table .ifacebox-body > span { flex: 10 10 auto; font-size: 12px; + height: 100%; } .network-status-table .ifacebox-body > div { 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 c10dea9dd5..c20d9c0485 100644 --- a/themes/luci-theme-rosy/luasrc/view/themes/rosy/header.htm +++ b/themes/luci-theme-rosy/luasrc/view/themes/rosy/header.htm @@ -3,7 +3,7 @@ luci-theme-rosy Copyright 2018 Rosy Song <rosysong@rosinson.com> Copyright 2018 Yan Lan Shen <yanlan.shen@rosinson.com> - + Have a bug? Please create an issue here on GitHub! https://github.com/rosywrt/luci-theme-rosy/issues @@ -146,68 +146,44 @@ end end - local function render_logout() - 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) - + local function render_logout() + 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 - local title = pcdata(striptags(translate(nnode.title))) - - write('<span class="label logout"><a data-title="%s" href="%s">%s</a></span>' %{ - title, - nodeurl(category, r, nnode.query), - title - }) - end - end - - end - end - - - local function render_changes() - -- calculate the number of unsaved changes - if tree.nodes[category] and tree.nodes[category].ucidata then - local ucichanges = 0 - - for i, j in pairs(require("luci.model.uci").cursor():changes()) do - for k, l in pairs(j) do - for m, n in pairs(l) do - ucichanges = ucichanges + 1; - end - end - end + local title = pcdata(striptags(translate(nnode.title))) + + write('<span class="label logout"><a data-title="%s" href="%s">%s</a></span>' %{ + title, + nodeurl(category, r, nnode.query), + title + }) + end + end + + end + end - if ucichanges > 0 then - write('<a class="uci_change_indicator label notice" href="%s?redir=%s"><span class="mobile-hide">%s:</span> %d</a>' %{ - url(category, 'uci/changes'), - http.urlencode(http.formvalue('redir') or table.concat(disp.context.request, "/")), - translate('Unsaved Changes'), - ucichanges - }) - end - end - end local function auth_level() - local childs = disp.node_childs(cattree) + 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) - + 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 + end end -- If this value is returned, the current interface is the login interface return "login" @@ -260,7 +236,6 @@ <span class="showSide"></span> <a class="brand PC-hide" href="#"><%=boardinfo.hostname or "?"%></a> <div class="btn-con pull-right"> - <% render_changes() %> <span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()"> <span class="label success" id="xhr_poll_status_on"><span class="mobile-hide"> <%:Auto Refresh%></span> @@ -274,10 +249,10 @@ </div> </header> <div style="" class="loading"> - <span> - <div class="loading-img"> - <img src="<%=media%>/loading.svg"> - </div>Loading... + <span> + <div class="loading-img"> + <img src="<%=media%>/loading.svg"> + </div>Loading... </span> </div> <div class="main"> @@ -292,10 +267,10 @@ </div> <div class="main-right"> <div id="maincontent"> - <div class="logoImg"> - <img class="mobile-hide" src="<%=media%>/logo.png" alt="Rosy"> + <div class="logoImg"> + <img class="mobile-hide" src="<%=media%>/logo.png" alt="Rosy"> <img src="<%=media%>/mobile-loginBG.png" class="PC-hide"> - <a class="brand" href="#"><%=boardinfo.hostname or "?"%></a> + <a class="brand" href="#"><%=boardinfo.hostname or "?"%></a> </div> <div class="container"> <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%> |