Cleanup overview / details nodes
authorSteven Barth <steven@midlink.org>
Sun, 4 Jan 2009 15:46:08 +0000 (15:46 +0000)
committerSteven Barth <steven@midlink.org>
Sun, 4 Jan 2009 15:46:08 +0000 (15:46 +0000)
applications/luci-fw/luasrc/controller/luci_fw/luci_fw.lua
applications/luci-fw/luasrc/model/cbi/luci_fw/rrule.lua
applications/luci-fw/luasrc/model/cbi/luci_fw/trule.lua
modules/admin-full/luasrc/controller/admin/network.lua

index 90213cf544db6d5b497e632c13ac4c201b54bbbe..2be03d688325dba64a8b1e0a52dc1c062f1e0867 100644 (file)
@@ -3,25 +3,11 @@ module("luci.controller.luci_fw.luci_fw", package.seeall)
 function index()
        require("luci.i18n").loadc("luci-fw")
        local i18n = luci.i18n.translate
-       
-       local nodes = {}
 
-       table.insert(nodes, entry({"admin", "network", "firewall"}, alias("admin", "network", "firewall", "zones"), i18n("fw_fw"), 60))
-       nodes[#nodes].index = true
-       
-       table.insert(nodes, entry({"admin", "network", "firewall", "zones"}, cbi("luci_fw/zones"), i18n("fw_zones"), 10))
-       table.insert(nodes, entry({"admin", "network", "firewall", "redirection"}, cbi("luci_fw/redirect"), i18n("fw_redirect"), 30))   
-       table.insert(nodes, entry({"admin", "network", "firewall", "traffic"}, cbi("luci_fw/traffic"), i18n("fw_traffic"), 20))
-               
-       table.insert(nodes, entry({"admin", "network", "firewall", "rule"}, cbi("luci_fw/trule")))
-       nodes[#nodes].leaf = true
-       table.insert(nodes, entry({"admin", "network", "firewall", "redirect"}, cbi("luci_fw/rrule")))
-       nodes[#nodes].leaf = true
-       
-       table.insert(nodes, entry({"mini", "network", "portfw"}, cbi("luci_fw/miniportfw", {autoapply=true}), i18n("fw_portfw", "Portweiterleitung"), 70))
+       entry({"admin", "network", "firewall"}, alias("admin", "network", "firewall", "zones"), i18n("fw_fw"), 60).i18n = "luci-fw"
+       entry({"admin", "network", "firewall", "zones"}, cbi("luci_fw/zones"), i18n("fw_zones"), 10)
+       entry({"admin", "network", "firewall", "redirect"}, arcombine(cbi("luci_fw/redirect"), cbi("luci_fw/rrule")), i18n("fw_redirect"), 30).leaf = true      
+       entry({"admin", "network", "firewall", "rule"}, arcombine(cbi("luci_fw/traffic"), cbi("luci_fw/trule")), i18n("fw_traffic"), 20).leaf = true
        
-       for i,n in ipairs(nodes) do
-               n.i18n = "luci-fw"
-               n.dependent = true
-       end     
+       entry({"mini", "network", "portfw"}, cbi("luci_fw/miniportfw", {autoapply=true}), i18n("fw_portfw", "Portweiterleitung"), 70).i18n = "luci-fw"
 end
\ No newline at end of file
index 1610698c4b01085eb64ae017ec184ebe5e4160ac..9c40d958f568d72eff4d1c94baf0ac1a820044b9 100644 (file)
@@ -23,7 +23,7 @@ s.addremove = false
 
 back = s:option(DummyValue, "_overview", translate("overview"))
 back.value = ""
-back.titleref = luci.dispatcher.build_url("admin", "network", "firewall", "redirection")
+back.titleref = luci.dispatcher.build_url("admin", "network", "firewall", "redirect")
 
 name = s:option(Value, "_name", translate("name"))
 name.rmempty = true
index f860bff3e605fdfc9501ec66bf67ddf77ad9d2c2..d8fe59c9bd1ff99c4c92c60186789b814ffed887 100644 (file)
@@ -20,7 +20,7 @@ s.addremove = false
 
 back = s:option(DummyValue, "_overview", translate("overview"))
 back.value = ""
-back.titleref = luci.dispatcher.build_url("admin", "network", "firewall", "traffic")
+back.titleref = luci.dispatcher.build_url("admin", "network", "firewall", "rule")
 
 
 name = s:option(Value, "_name", translate("name")..translate("cbi_optional"))
index 778a70fb96b22b703c8f13103e67ca76d30e127e..a14b8fd700e1c74871f8bbaac61f705ee8a7dcb1 100644 (file)
@@ -28,47 +28,36 @@ function index()
        page.target = cbi("admin_network/vlan")
        page.title  = i18n("a_n_switch")
        page.order  = 20
-
-       local page  = node("admin", "network", "wireless")
-       page.target = form("admin_network/wireless")
-       page.title  = i18n("wifi")
+       
+       local page = entry({"admin", "network", "wireless"}, arcombine(cbi("admin_network/wireless"), cbi("admin_network/wifi")), i18n("wifi"), 15)
        page.i18n   = "wifi"
-       page.order  = 15
+       page.leaf = true
        page.subindex = true
+       
        uci:foreach("wireless", "wifi-device",
                function (section)
                        local ifc = section[".name"]
                                entry({"admin", "network", "wireless", ifc},
-                                alias("admin", "network", "wifi", ifc),
+                                true,
                                 ifc:upper()).i18n = "wifi"
                end
        )
-
-       local page  = node("admin", "network", "wifi")
-       page.target = cbi("admin_network/wifi")
+       
+       local page = entry({"admin", "network", "network"}, arcombine(cbi("admin_network/network"), cbi("admin_network/ifaces")), i18n("interfaces", "Schnittstellen"), 10)
        page.leaf   = true
-       page.i18n = "wifi"
-
-       local page  = node("admin", "network", "network")
-       page.target = cbi("admin_network/network")
-       page.title  = i18n("interfaces", "Schnittstellen")
-       page.order  = 10
        page.subindex = true
+       
        uci:foreach("network", "interface",
                function (section)
                        local ifc = section[".name"]
                        if ifc ~= "loopback" then
                                entry({"admin", "network", "network", ifc},
-                                alias("admin", "network", "ifaces", ifc),
+                                true,
                                 ifc:upper())
                        end
                end
        )
 
-       local page  = node("admin", "network", "ifaces")
-       page.target = cbi("admin_network/ifaces")
-       page.leaf   = true
-
        local page  = node("admin", "network", "dhcp")
        page.target = cbi("admin_network/dhcp")
        page.title  = "DHCP"
@@ -105,4 +94,4 @@ function index()
                60
        )
 
-end
+end
\ No newline at end of file