summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full/luasrc/model
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-09-14 09:28:28 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-09-14 09:28:28 +0000
commita4ea7904b87954730929a90cc610c3da451f576f (patch)
tree1813053b1ccd16e0bcd8af3fe141223c0ebc0d57 /modules/admin-full/luasrc/model
parent537c929d636b1f147e23c2f21c56e3f8bf6f7534 (diff)
modules/admin-full: fix initial state of network_ifacelist widget
Diffstat (limited to 'modules/admin-full/luasrc/model')
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua10
1 files changed, 8 insertions, 2 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 84d7ba5c66..8f5f5e42fa 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
@@ -123,7 +123,6 @@ ifname_single.template = "cbi/network_ifacelist"
ifname_single.widget = "radio"
ifname_single.nobridges = true
ifname_single.network = arg[1]
-ifname_single.rmempty = true
ifname_single:depends({ type = "", proto = "static" })
ifname_single:depends({ type = "", proto = "dhcp" })
ifname_single:depends({ type = "", proto = "pppoe" })
@@ -132,7 +131,8 @@ ifname_single:depends({ type = "", proto = "ahcp" })
ifname_single:depends({ type = "", proto = "none" })
function ifname_single.cfgvalue(self, s)
- return self.map.uci:get("network", s, "ifname")
+ -- let the template figure out the related ifaces through the network model
+ return nil
end
function ifname_single.write(self, s, val)
@@ -154,6 +154,11 @@ function ifname_single.write(self, s, val)
end
end
+function ifname_single.remove(self, s)
+ self:write(s, "")
+end
+
+
ifname_multi = s:taboption("physical", Value, "ifname_multi", translate("Interface"))
ifname_multi.template = "cbi/network_ifacelist"
ifname_multi.nobridges = true
@@ -162,6 +167,7 @@ ifname_multi.widget = "checkbox"
ifname_multi:depends("type", "bridge")
ifname_multi.cfgvalue = ifname_single.cfgvalue
ifname_multi.write = ifname_single.write
+ifname_multi.remove = ifname_single.remove
if has_firewall then