diff options
-rw-r--r-- | modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js index 1351ab935a..9ea5555deb 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js @@ -138,15 +138,24 @@ function buildVLANMappings(mapping) } } -function resolveVLANPorts(ifname, mapping) +function resolveVLANPorts(ifname, mapping, seen) { var ports = []; - if (mapping[ifname]) - for (var i = 0; i < mapping[ifname].length; i++) - ports.push.apply(ports, resolveVLANPorts(mapping[ifname][i], mapping)); - else + if (!seen) + seen = {}; + + if (mapping[ifname]) { + for (var i = 0; i < mapping[ifname].length; i++) { + if (!seen[mapping[ifname][i]]) { + seen[mapping[ifname][i]] = true; + ports.push.apply(ports, resolveVLANPorts(mapping[ifname][i], mapping, seen)); + } + } + } + else { ports.push(ifname); + } return ports.sort(L.naturalCompare); } |