X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=modules%2Fniu%2Fluasrc%2Fview%2Fniu%2Fdashboard.htm;h=7c387edd277169565a5a0ac780fe4c05aa9e82e4;hb=c36fd44de2db30c08848bf326365a1e372b7879c;hp=cdd65663f25fda92c7834141ead3e4a78313d921;hpb=c47765a6118b2a6eb0d74b95f5cb4abda23fe6db;p=project%2Fluci.git diff --git a/modules/niu/luasrc/view/niu/dashboard.htm b/modules/niu/luasrc/view/niu/dashboard.htm index cdd65663f..7c387edd2 100644 --- a/modules/niu/luasrc/view/niu/dashboard.htm +++ b/modules/niu/luasrc/view/niu/dashboard.htm @@ -1,17 +1,34 @@ -<%+header%> +<% +local dsp = require "luci.dispatcher" +local utl = require "luci.util" -<% +include("header") + local function cmp(a, b) - return (a.order or 100) < (b.order or 100) + return (nodes[a].order or 100) < (nodes[b].order or 100) end for k, v in utl.spairs(nodes, cmp) do - if v.dbtemplate then + if v.niu_dbtemplate or v.niu_dbtasks then %> -
- <%=v.title%> - <% - tpl.render(v.dbtemplate) - %> +
+ style="background-image: url(<%=resource%>/<%=v.niu_dbicon%>)"<% end %>><%=v.title%> + <% if v.niu_dbtemplate then tpl.render(v.niu_dbtemplate) end %> + <% if v.niu_dbtasks then %> +

Tasks:

+
    + <% + local nodes = dsp.node("niu", k).nodes + local function cmp(a, b) + return (nodes[a].order or 100) < (nodes[b].order or 100) + end + for k2, v2 in utl.spairs(nodes, cmp) do + %> +
  • "><%=v2.title%>
  • + <% + end + %> +
+ <% end %>
<% end