From a4ea7904b87954730929a90cc610c3da451f576f Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 14 Sep 2011 09:28:28 +0000 Subject: [PATCH] modules/admin-full: fix initial state of network_ifacelist widget --- .../luasrc/model/cbi/admin_network/ifaces.lua | 10 ++++++++-- 1 file 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 -- 2.30.2