提交 76e5b68b 编写于 作者: J Jo-Philipp Wich

modules/admin-full: don't expose "reset" and "enable" options for switches, do...

modules/admin-full: don't expose "reset" and "enable" options for switches, do not set any default state for "enable_vlan"
上级 691b9368
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册