Changeset 5555

Show
Ignore:
Timestamp:
11/16/09 17:58:48 (4 years ago)
Author:
Cyrus
Message:

NIU:
+PortFw?
+QoS
Reorganize Network

Location:
luci/trunk/modules/niu
Files:
13 added
3 modified
3 moved

Legend:

Unmodified
Added
Removed
  • luci/trunk/modules/niu/luasrc/controller/niu/network.lua

    r5541 r5555  
    3333        if s.interface == "lan" and s.ignore ~= "1" then  
    3434            entry({"niu", "network", "assign"}, cbi("niu/network/assign", 
    35                 toniu), "Display and Customize Address Assignment", 30) 
     35                toniu), "Manage Address Assignment", 30) 
    3636        end 
    3737    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) 
    4438      
    4539     if fs.access("/etc/config/ddns") then 
     
    4842     end 
    4943end 
    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  
    1919    local toniu = {on_success_to={"niu"}} 
    2020 
    21     local e = entry({"niu", "system"}, alias("niu"), "System", 30) 
     21    local e = entry({"niu", "system"}, alias("niu"), "System", 40) 
    2222    e.niu_dbtemplate = "niu/system" 
    2323    e.niu_dbtasks = true 
  • luci/trunk/modules/niu/luasrc/model/cbi/niu/traffic/routes.lua

    r5436 r5555  
    55d.allow_cancel = true 
    66 
    7 d:add("routes1", load("niu/network/routes1")) 
     7d:add("routes1", load("niu/traffic/routes1")) 
    88 
    99function d.on_cancel() 
  • luci/trunk/modules/niu/luasrc/view/niu/network.htm

    r5551 r5555  
    1616local wanup = uci.inst_state:get("network", "wan", "up") 
    1717local wanip = uci.inst_state:get("network", "wan", "ipaddr") 
    18 local wanif = uci.inst_state:get("network", "wan", "ifname") 
    19 local wanul, wandl 
    20  
    21 if wanif then 
    22     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 end 
    2918 
    3019local leasefn 
     
    5847<tr> 
    5948<% if wanup then %> 
    60 <th>Uplink Address</th> 
     49<th>Uplink Address:</th> 
    6150<td><%=wanip%></td> 
    6251<% else %> 
    63 <th>Uplink</th> 
     52<th>Uplink:</th> 
    6453<td><span style="color: darkred"><em>offline</em></span> 
    6554</td> 
     
    6958<% end %> 
    7059 
    71 <% if wanul and wandl then %> 
    7260<tr> 
    73 <th>Uplink Traffic</th><td> 
    74 <%=("%.2f"):format(wandl)%> GB&#8659; <%=("%.2f"):format(wanul)%> GB&#8657; 
    75 </td> 
    76 </tr> 
    77 <% end %>  
    78  
    79 <tr> 
    80 <th>Local Address</th><td> 
     61<th>Local Address:</th><td> 
    8162<%=uci.inst_state:get("network", "lan", "ipaddr")%> 
    8263</td> 
     
    8566<% if arps then %> 
    8667<tr> 
    87 <th>Active IP-Devices</th><td><%=arps%><% if leasefn then %> 
     68<th>Active IP-Devices:</th><td><%=arps%><% if leasefn then %> 
    8869(<%=leasefn%> assigned) 
    8970<% end %></td>