NIU:
[project/luci.git] / modules / niu / luasrc / controller / niu / network.lua
index b17e6e7..c90662b 100644 (file)
@@ -12,16 +12,32 @@ You may obtain a copy of the License at
 $Id$
 ]]--
 
-local req = require
+local require = require
 module "luci.controller.niu.network"
 
 function index()
-       entry({"niu", "network"}, alias("admin", "network"), "Network")
-       .dbtemplate = "niu/network"
+       entry({"niu", "network"}, nil, "Network", 10).dbtemplate = "niu/network"
+
+       entry({"niu", "network", "wan"}, 
+       cbi("niu/network/wan", {on_success_to={"niu"}}), "Configure Internet Connection", 10)
 
        entry({"niu", "network", "lan"}, 
-       cbi("niu/network/lan", {on_success_to={"niu"}}), "Configure LAN")
+       cbi("niu/network/lan", {on_success_to={"niu"}}), "Configure Local Network", 20)
+       
+       uci.inst_state:foreach("dhcp", "dhcp", function(s)
+               if s.interface == "lan" and s.ignore ~= "1" then 
+                       entry({"niu", "network", "assign"}, cbi("niu/network/assign",
+                               {on_success_to={"niu"}}), "Display and Customize Address Assignment", 30)
+               end
+       end)
+       
+       entry({"niu", "network", "routes"},  cbi("niu/network/routes",
+        {on_success_to={"niu"}}), "Display and Customize Routing", 40)
+        
+       entry({"niu", "network", "conntrack"},  call("cnntrck"),
+        "Display Local Network Activity", 50)
+end
 
-       entry({"niu", "network", "wan"}, 
-       cbi("niu/network/wan", {on_success_to={"niu"}}), "Configure Internet")
+function cnntrck()
+       require "luci.template".render("niu/network/conntrack")
 end