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
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
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"))
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"
60
)
-end
+end
\ No newline at end of file