diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-01-28 10:08:40 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-01-28 18:16:43 +0100 |
commit | 616d44c155ae2b4f19e8b2645744a107e38a56c7 (patch) | |
tree | 5618f874bf9fded3de7dea8584d9617bd367d141 | |
parent | b60b4790d1b1b8d52657c0c9ba91da86d0b8a28d (diff) |
luci-mod-network: handle missing switch port state information
Ref: https://github.com/openwrt/luci/issues/3565
Ref: https://forum.openwrt.org/t/cannot-read-property-link/50766
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js index c20665adf0..4467238034 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js @@ -66,7 +66,7 @@ function render_port_status(node, portstate) { if (!node) return null; - if (!portstate.link) + if (!portstate || !portstate.link) L.dom.content(node, [ E('img', { src: L.resource('icons/port_down.png') }), E('br'), @@ -146,7 +146,7 @@ return L.view.extend({ if (!topology) { ui.addNotification(null, _('Switch %q has an unknown topology - the VLAN settings might not be accurate.').replace(/%q/, switch_name)); - topology = { + topologies[switch_name] = topology = { features: {}, netdevs: { 5: 'eth0' |