Changeset 5555
- Timestamp:
- 11/16/09 17:58:48 (4 years ago)
- Location:
- luci/trunk/modules/niu
- Files:
-
- 13 added
- 3 modified
- 3 moved
-
htdocs/luci-static/resources/icons32/preferences-system-network.png (added)
-
luasrc/controller/niu/network.lua (modified) (2 diffs)
-
luasrc/controller/niu/system.lua (modified) (1 diff)
-
luasrc/controller/niu/traffic.lua (added)
-
luasrc/model/cbi/niu/traffic (added)
-
luasrc/model/cbi/niu/traffic/portfw.lua (added)
-
luasrc/model/cbi/niu/traffic/portfw1.lua (added)
-
luasrc/model/cbi/niu/traffic/qos.lua (added)
-
luasrc/model/cbi/niu/traffic/qos1.lua (added)
-
luasrc/model/cbi/niu/traffic/routes.lua (moved) (moved from luci/trunk/modules/niu/luasrc/model/cbi/niu/network/routes.lua) (1 diff)
-
luasrc/model/cbi/niu/traffic/routes1.lua (moved) (moved from luci/trunk/modules/niu/luasrc/model/cbi/niu/network/routes1.lua)
-
luasrc/view/niu/network.htm (modified) (4 diffs)
-
luasrc/view/niu/traffic (added)
-
luasrc/view/niu/traffic.htm (added)
-
luasrc/view/niu/traffic/conntrack.htm (moved) (moved from luci/trunk/modules/niu/luasrc/view/niu/network/conntrack.htm)
-
root (added)
-
root/etc (added)
-
root/etc/uci-defaults (added)
-
root/etc/uci-defaults/luci-niu-firstrun (added)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/modules/niu/luasrc/controller/niu/network.lua
r5541 r5555 33 33 if s.interface == "lan" and s.ignore ~= "1" then 34 34 entry({"niu", "network", "assign"}, cbi("niu/network/assign", 35 toniu), " Display and Customize Address Assignment", 30)35 toniu), "Manage Address Assignment", 30) 36 36 end 37 37 end) 38 39 entry({"niu", "network", "routes"}, cbi("niu/network/routes",40 toniu), "Display and Customize Routing", 40)41 42 entry({"niu", "network", "conntrack"}, call("cnntrck"),43 "Display Local Network Activity", 50)44 38 45 39 if fs.access("/etc/config/ddns") then … … 48 42 end 49 43 end 50 51 function cnntrck()52 require "luci.template".render("niu/network/conntrack")53 end -
luci/trunk/modules/niu/luasrc/controller/niu/system.lua
r5544 r5555 19 19 local toniu = {on_success_to={"niu"}} 20 20 21 local e = entry({"niu", "system"}, alias("niu"), "System", 30)21 local e = entry({"niu", "system"}, alias("niu"), "System", 40) 22 22 e.niu_dbtemplate = "niu/system" 23 23 e.niu_dbtasks = true -
luci/trunk/modules/niu/luasrc/model/cbi/niu/traffic/routes.lua
r5436 r5555 5 5 d.allow_cancel = true 6 6 7 d:add("routes1", load("niu/ network/routes1"))7 d:add("routes1", load("niu/traffic/routes1")) 8 8 9 9 function d.on_cancel() -
luci/trunk/modules/niu/luasrc/view/niu/network.htm
r5551 r5555 16 16 local wanup = uci.inst_state:get("network", "wan", "up") 17 17 local wanip = uci.inst_state:get("network", "wan", "ipaddr") 18 local wanif = uci.inst_state:get("network", "wan", "ifname")19 local wanul, wandl20 21 if wanif then22 local devstats = fs.readfile("/proc/net/dev")23 local rx, tx = devstats:match("%s*"..wanif..24 ":%s*([0-9]+)%s+[0-9]+%s+[0-9]+%s+[0-9]+%s+"..25 "[0-9]+%s+[0-9]+%s+[0-9]+%s+[0-9]+%s+([0-9]+)")26 wanul = tx and (tonumber(tx) / 1000000000)27 wandl = rx and (tonumber(rx) / 1000000000)28 end29 18 30 19 local leasefn … … 58 47 <tr> 59 48 <% if wanup then %> 60 <th>Uplink Address </th>49 <th>Uplink Address:</th> 61 50 <td><%=wanip%></td> 62 51 <% else %> 63 <th>Uplink </th>52 <th>Uplink:</th> 64 53 <td><span style="color: darkred"><em>offline</em></span> 65 54 </td> … … 69 58 <% end %> 70 59 71 <% if wanul and wandl then %>72 60 <tr> 73 <th>Uplink Traffic</th><td> 74 <%=("%.2f"):format(wandl)%> GB⇓ <%=("%.2f"):format(wanul)%> GB⇑ 75 </td> 76 </tr> 77 <% end %> 78 79 <tr> 80 <th>Local Address</th><td> 61 <th>Local Address:</th><td> 81 62 <%=uci.inst_state:get("network", "lan", "ipaddr")%> 82 63 </td> … … 85 66 <% if arps then %> 86 67 <tr> 87 <th>Active IP-Devices </th><td><%=arps%><% if leasefn then %>68 <th>Active IP-Devices:</th><td><%=arps%><% if leasefn then %> 88 69 (<%=leasefn%> assigned) 89 70 <% end %></td>
