diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-11-01 20:03:36 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-11-01 20:03:36 +0000 |
commit | 36f88887c19d2b0098ae1965b6725845705efc51 (patch) | |
tree | 4b73eab4ac1485ce96417803167e47a696b39c7a /modules/admin-full/luasrc/model | |
parent | 59af400346d15250af5873db66e420592a5b9ff9 (diff) |
modules/admin-core, modules/admin-full: fix switch port status for devices with multiple switches
Diffstat (limited to 'modules/admin-full/luasrc/model')
-rw-r--r-- | modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua | 15 |
1 files changed, 9 insertions, 6 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 9dc3f2f636..b0de19133d 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua @@ -14,6 +14,8 @@ You may obtain a copy of the License at m = Map("network", translate("Switch"), translate("The network ports on this device can be combined to several <abbr title=\"Virtual Local Area Network\">VLAN</abbr>s in which computers can communicate directly with each other. <abbr title=\"Virtual Local Area Network\">VLAN</abbr>s are often used to separate different network segments. Often there is by default one Uplink port for a connection to the next greater network like the internet and other ports for a local network.")) +local switches = { } + m.uci:foreach("network", "switch", function(x) local sid = x['.name'] @@ -199,7 +201,7 @@ m.uci:foreach("network", "switch", end - local vid = s:option(Value, has_vlan4k or "vlan", "VLAN ID") + local vid = s:option(Value, has_vlan4k or "vlan", "VLAN ID", "<div id='portstatus-%s'></div>" % switch_name) vid.rmempty = false vid.forcewrite = true @@ -276,12 +278,13 @@ m.uci:foreach("network", "switch", port_opts[#port_opts+1] = po end - - -- Switch status template - s = m:section(SimpleSection) - s.template = "admin_network/switch_status" - s.switch = switch_name + switches[#switches+1] = switch_name end ) +-- Switch status template +s = m:section(SimpleSection) +s.template = "admin_network/switch_status" +s.switches = switches + return m |