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>
This commit is contained in:
parent
b60b4790d1
commit
616d44c155
1 changed files with 2 additions and 2 deletions
|
@ -66,7 +66,7 @@ function render_port_status(node, portstate) {
|
||||||
if (!node)
|
if (!node)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (!portstate.link)
|
if (!portstate || !portstate.link)
|
||||||
L.dom.content(node, [
|
L.dom.content(node, [
|
||||||
E('img', { src: L.resource('icons/port_down.png') }),
|
E('img', { src: L.resource('icons/port_down.png') }),
|
||||||
E('br'),
|
E('br'),
|
||||||
|
@ -146,7 +146,7 @@ return L.view.extend({
|
||||||
if (!topology) {
|
if (!topology) {
|
||||||
ui.addNotification(null, _('Switch %q has an unknown topology - the VLAN settings might not be accurate.').replace(/%q/, switch_name));
|
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: {},
|
features: {},
|
||||||
netdevs: {
|
netdevs: {
|
||||||
5: 'eth0'
|
5: 'eth0'
|
||||||
|
|
Loading…
Reference in a new issue