From: Steven Barth Date: Sun, 4 Jan 2009 15:46:08 +0000 (+0000) Subject: Cleanup overview / details nodes X-Git-Tag: 0.9.0~831 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bb44869de9ba8d5035d4c74e3651e911e959a863;p=oweals%2Fluci.git Cleanup overview / details nodes --- diff --git a/applications/luci-fw/luasrc/controller/luci_fw/luci_fw.lua b/applications/luci-fw/luasrc/controller/luci_fw/luci_fw.lua index 90213cf54..2be03d688 100644 --- a/applications/luci-fw/luasrc/controller/luci_fw/luci_fw.lua +++ b/applications/luci-fw/luasrc/controller/luci_fw/luci_fw.lua @@ -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 diff --git a/applications/luci-fw/luasrc/model/cbi/luci_fw/rrule.lua b/applications/luci-fw/luasrc/model/cbi/luci_fw/rrule.lua index 1610698c4..9c40d958f 100644 --- a/applications/luci-fw/luasrc/model/cbi/luci_fw/rrule.lua +++ b/applications/luci-fw/luasrc/model/cbi/luci_fw/rrule.lua @@ -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 diff --git a/applications/luci-fw/luasrc/model/cbi/luci_fw/trule.lua b/applications/luci-fw/luasrc/model/cbi/luci_fw/trule.lua index f860bff3e..d8fe59c9b 100644 --- a/applications/luci-fw/luasrc/model/cbi/luci_fw/trule.lua +++ b/applications/luci-fw/luasrc/model/cbi/luci_fw/trule.lua @@ -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")) diff --git a/modules/admin-full/luasrc/controller/admin/network.lua b/modules/admin-full/luasrc/controller/admin/network.lua index 778a70fb9..a14b8fd70 100644 --- a/modules/admin-full/luasrc/controller/admin/network.lua +++ b/modules/admin-full/luasrc/controller/admin/network.lua @@ -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