modules/admin-full: use new Flag default facility to improve handling of peerdns and defaultroute bools
This commit is contained in:
parent
be5b1015b2
commit
3be5b9fa06
1 changed files with 3 additions and 13 deletions
|
@ -398,10 +398,7 @@ if has_pptp or has_pppd or has_pppoe or has_pppoa or has_3g then
|
||||||
defaultroute:depends("proto", "pppoe")
|
defaultroute:depends("proto", "pppoe")
|
||||||
defaultroute:depends("proto", "pptp")
|
defaultroute:depends("proto", "pptp")
|
||||||
defaultroute:depends("proto", "3g")
|
defaultroute:depends("proto", "3g")
|
||||||
defaultroute.rmempty = false
|
defaultroute.default = defaultroute.enabled
|
||||||
function defaultroute.cfgvalue(...)
|
|
||||||
return ( AbstractValue.cfgvalue(...) or '1' )
|
|
||||||
end
|
|
||||||
|
|
||||||
peerdns = s:taboption("ppp", Flag, "peerdns",
|
peerdns = s:taboption("ppp", Flag, "peerdns",
|
||||||
translate("Use peer DNS"),
|
translate("Use peer DNS"),
|
||||||
|
@ -412,10 +409,7 @@ if has_pptp or has_pppd or has_pppoe or has_pppoa or has_3g then
|
||||||
peerdns:depends("proto", "pppoe")
|
peerdns:depends("proto", "pppoe")
|
||||||
peerdns:depends("proto", "pptp")
|
peerdns:depends("proto", "pptp")
|
||||||
peerdns:depends("proto", "3g")
|
peerdns:depends("proto", "3g")
|
||||||
peerdns.rmempty = false
|
peerdns.default = peerdns.enabled
|
||||||
function peerdns.cfgvalue(...)
|
|
||||||
return ( AbstractValue.cfgvalue(...) or '1' )
|
|
||||||
end
|
|
||||||
|
|
||||||
if has_ipv6 then
|
if has_ipv6 then
|
||||||
ipv6 = s:taboption("ppp", Flag, "ipv6", translate("Enable IPv6 on PPP link") )
|
ipv6 = s:taboption("ppp", Flag, "ipv6", translate("Enable IPv6 on PPP link") )
|
||||||
|
@ -573,11 +567,7 @@ if has_dnsmasq then
|
||||||
translate("Dynamic <abbr title=\"Dynamic Host Configuration Protocol\">DHCP</abbr>"),
|
translate("Dynamic <abbr title=\"Dynamic Host Configuration Protocol\">DHCP</abbr>"),
|
||||||
translate("Dynamically allocate DHCP addresses for clients. If disabled, only " ..
|
translate("Dynamically allocate DHCP addresses for clients. If disabled, only " ..
|
||||||
"clients having static leases will be served."))
|
"clients having static leases will be served."))
|
||||||
|
dd.default = dd.enabled
|
||||||
dd.rmempty = false
|
|
||||||
function dd.cfgvalue(self, section)
|
|
||||||
return Flag.cfgvalue(self, section) or "1"
|
|
||||||
end
|
|
||||||
|
|
||||||
s:taboption("advanced", Flag, "force", translate("Force"),
|
s:taboption("advanced", Flag, "force", translate("Force"),
|
||||||
translate("Force DHCP on this network even if another server is detected."))
|
translate("Force DHCP on this network even if another server is detected."))
|
||||||
|
|
Loading…
Reference in a new issue