2 local uci = require "luci.model.uci"
3 local fs = require "nixio.fs"
6 uci.inst_state:foreach("network", "interface", function(s)
10 if uci.inst_state:get("network", "lan", "_ipchanged") and
11 uci.inst_state:revert("network", "lan", "_ipchanged") then
12 include("niu/network/warn_ip_change")
15 local wanon = uci.inst_state:get("network", "wan", "proto")
16 local wanup = uci.inst_state:get("network", "wan", "up")
17 local wanip = uci.inst_state:get("network", "wan", "ipaddr")
20 uci.inst:foreach("dhcp", "dnsmasq",
22 leasefn = section.leasefile
27 local ln = fs.access(leasefn, "r") and io.lines(leasefn)
35 if fs.access("/proc/net/arp", "r") then
36 local ln = io.lines("/proc/net/arp")
41 arps = arps >= 0 and arps
45 <table class="dbstattbl">
46 <% if wanon and wanon ~= "none" then %>
49 <th>Uplink Address:</th>
53 <td><span style="color: darkred"><em>offline</em></span>
61 <th>Local Address:</th><td>
62 <%=uci.inst_state:get("network", "lan", "ipaddr")%>
68 <th>Active IP-Devices:</th><td><%=arps%><% if leasefn then %>
69 (<%=leasefn%> assigned)