diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-07-17 05:46:54 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-07-17 05:46:54 +0000 |
commit | 76e5b68bb921fdbb95cec4a42cb3c69800e6ac41 (patch) | |
tree | 5bd3c29d4fe68dbefdc7dc16fad890ebd3acdaaf /modules | |
parent | 691b93686dbf4e3356bbc18e0210686c030d367c (diff) |
modules/admin-full: don't expose "reset" and "enable" options for switches, do not set any default state for "enable_vlan"
Diffstat (limited to 'modules')
-rw-r--r-- | modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua b/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua index c2f1c1fe5..ee35261b8 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua @@ -18,8 +18,6 @@ m = Map("network", translate("Switch"), translate("The network ports on your rou m.uci:foreach("network", "switch", function(x) local switch_name = x.name or x['.name'] - local has_enable = "enable" - local has_reset = nil local has_vlan = nil local has_learn = nil local has_vlan4k = nil @@ -55,11 +53,10 @@ m.uci:foreach("network", "switch", num_ports, cpu_port, num_vlans = line:match("ports: (%d+) %(cpu @ (%d+)%), vlans: (%d+)") - num_ports = tonumber(num_ports or 6) - num_vlans = tonumber(num_vlans or 16) - cpu_port = tonumber(cpu_port or 5) + num_ports = tonumber(num_ports) or 6 + num_vlans = tonumber(num_vlans) or 16 + cpu_port = tonumber(cpu_port) or 5 min_vid = 1 - has_enable = nil elseif line:match(": pvid") or line:match(": tag") or line:match(": vid") then if is_vlan_attr then has_vlan4k = line:match(": (%w+)") end @@ -71,9 +68,6 @@ m.uci:foreach("network", "switch", elseif line:match(": enable_learning") then has_learn = "enable_learning" - elseif line:match(": reset") then - has_reset = "reset" - elseif line:match(": enable_vlan4k") then enable_vlan4k = true @@ -117,14 +111,8 @@ m.uci:foreach("network", "switch", s = m:section(NamedSection, x['.name'], "switch", translatef("Switch %q", switch_name)) s.addremove = false - if has_enable then - x = s:option(Flag, has_enable, translate("Enable this switch")) - x.default = x.enabled - end - if has_vlan then - x = s:option(Flag, has_vlan, translate("Enable VLAN functionality")) - x.default = x.enabled + s:option(Flag, has_vlan, translate("Enable VLAN functionality")) end if enable_vlan4k then @@ -142,11 +130,6 @@ m.uci:foreach("network", "switch", x.rmempty = true end - if has_reset then - x = s:option(Flag, has_reset, translate("Reset switch during setup")) - x.default = x.enabled - end - -- VLAN table s = m:section(TypedSection, "switch_vlan", translatef("VLANs on %q", switch_name)) |