summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full/luasrc
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-11 22:00:47 +0000
committerSteven Barth <steven@midlink.org>2008-08-11 22:00:47 +0000
commit01a4a3ab7333c393faf1c859af8a2dc3f6eb27b0 (patch)
treeb1a49667ad193f915b9682e49b2ebbd597f56479 /modules/admin-full/luasrc
parent4e26d886eb498abc2655c89eae10983a507b7606 (diff)
modules/admin-full: Preparing rewrite of network interface configuration
Diffstat (limited to 'modules/admin-full/luasrc')
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
index dc50fdc94f..c85b6a1821 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
@@ -13,7 +13,17 @@ $Id$
]]--
m = Map("network", translate("interfaces"), translate("a_n_ifaces1"))
+arg = arg or {}
+
s = m:section(TypedSection, "interface", translate("interfaces"))
+function s.create(self, section)
+ local stat = TypedSection.create(self, section)
+ if stat then
+ arg = {section or stat}
+ end
+ return stat
+end
+
function s.filter(self, section)
return section ~= "loopback" and
(not arg or not arg[1] or arg[1] == section)
@@ -87,7 +97,7 @@ mac.optional = true
s2 = m:section(TypedSection, "alias", translate("aliases"))
s2.addremove = true
-if arg and arg[1] and luci.model.uci.get("network", arg[1]) then
+if arg and arg[1] then
s2:depends("interface", arg[1])
s2.defaults.interface = arg[1]
else