summaryrefslogtreecommitdiffhomepage
path: root/modules/niu/luasrc/view
diff options
context:
space:
mode:
Diffstat (limited to 'modules/niu/luasrc/view')
-rw-r--r--modules/niu/luasrc/view/niu/dashboard.htm22
-rw-r--r--modules/niu/luasrc/view/niu/network.htm32
-rw-r--r--modules/niu/luasrc/view/niu/null.htm1
3 files changed, 55 insertions, 0 deletions
diff --git a/modules/niu/luasrc/view/niu/dashboard.htm b/modules/niu/luasrc/view/niu/dashboard.htm
new file mode 100644
index 0000000000..cdd65663f2
--- /dev/null
+++ b/modules/niu/luasrc/view/niu/dashboard.htm
@@ -0,0 +1,22 @@
+<%+header%>
+
+<%
+local function cmp(a, b)
+ return (a.order or 100) < (b.order or 100)
+end
+for k, v in utl.spairs(nodes, cmp) do
+ if v.dbtemplate then
+ %>
+ <fieldset style="float: left; margin: 1em; padding: 0.5em">
+ <legend><%=v.title%></legend>
+ <%
+ tpl.render(v.dbtemplate)
+ %>
+ </fieldset>
+ <%
+ end
+end
+
+%>
+
+<%+footer%> \ No newline at end of file
diff --git a/modules/niu/luasrc/view/niu/network.htm b/modules/niu/luasrc/view/niu/network.htm
new file mode 100644
index 0000000000..71296371fd
--- /dev/null
+++ b/modules/niu/luasrc/view/niu/network.htm
@@ -0,0 +1,32 @@
+<%
+local dsp = require "luci.dispatcher"
+local utl = require "luci.util"
+local str = require "luci.store"
+
+local nws = {}
+str.uci_state:foreach("network", "interface", function(s)
+ nws[#nws+1] = s
+end)
+
+local function cmp(a, b)
+ return (a.order or 100) < (b.order or 100)
+end
+%>
+<div>Status:</div>
+<table>
+<%
+for _, v in ipairs(nws) do if v[".name"] ~= "loopback" then
+%>
+<tr><td><%=v[".name"]%></td><td><%=v.ipaddr%></td></tr>
+<% end end %>
+</table>
+<br />
+<ul>
+<%
+for k, v in utl.spairs(dsp.node("niu", "network").nodes, cmp) do
+%>
+<li><a href="<%=dsp.build_url("niu", "network", k)%>"><%=v.title%></a></li>
+<%
+end
+%>
+</ul> \ No newline at end of file
diff --git a/modules/niu/luasrc/view/niu/null.htm b/modules/niu/luasrc/view/niu/null.htm
new file mode 100644
index 0000000000..fe3a0735d9
--- /dev/null
+++ b/modules/niu/luasrc/view/niu/null.htm
@@ -0,0 +1 @@
+NULL \ No newline at end of file