luci-mod-admin-full: properly remap ports in switch status display

Fixes: 60c5d15e9 ("luci-mod-admin-full: fix possible switch status layout bug")
Fixes: bbf096c79 ("luci-mod-admin-full: cleanup markup")
Reported-at: https://forum.lede-project.org/t/x/15897/19
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2018-06-26 19:49:42 +02:00
parent 60c5d15e9e
commit 8d7869f672
2 changed files with 4 additions and 4 deletions

View file

@ -260,7 +260,7 @@ m.uci:foreach("network", "switch",
end
local vid = s:option(Value, has_vlan4k or "vlan", "VLAN ID", "<div id='portstatus-%s'></div>" % switch_name)
local vid = s:option(Value, has_vlan4k or "vlan", "VLAN ID")
local mx_vid = has_vlan4k and 4094 or (num_vlans - 1)
vid.rmempty = false
@ -333,7 +333,7 @@ m.uci:foreach("network", "switch",
local _, pt
for _, pt in ipairs(topo.ports) do
local po = s:option(ListValue, tostring(pt.num), pt.label, '<div id="portstatus-%s-%d"></div>' %{ switch_name, pt.num })
local po = s:option(ListValue, tostring(pt.num), pt.label)
po:value("", translate("off"))

View file

@ -33,9 +33,9 @@
{
for (var j = 0; j < ports.length; j++)
{
var th = tr.childNodes[j+1];
var th = tr.querySelector('[data-name="%d"]'.format(j));
if (!th || !th.hasAttribute('data-name'))
if (!th)
continue;
if (ports[j].link)