Fix display for networks without common name
This commit is contained in:
parent
243fe5c6a5
commit
edcf42eff7
2 changed files with 2 additions and 2 deletions
|
@ -234,7 +234,7 @@ def ping(request, device_id):
|
|||
ajax += ',\n "network": {'
|
||||
ajax += '\n "intip": "%s"' % device[0].network.intip
|
||||
ajax += ',\n "extip": "%s"' % device[0].network.extip
|
||||
ajax += ',\n "name": "%s"' % device[0].network.name
|
||||
ajax += ',\n "name": "%s"' % (device[0].network.name if device[0].network.name else "")
|
||||
ajax += '\n }'
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -30,7 +30,7 @@ function styleStatus(msg, device) {
|
|||
};
|
||||
|
||||
if (msg.hasOwnProperty("network")) {
|
||||
device_network.text(msg.network.intip + " (" + msg.network.name + ")");
|
||||
device_network.text(msg.network.intip + (msg.network.name ? (" (" + msg.network.name + ")") : ""));
|
||||
};
|
||||
|
||||
if (msg.hasOwnProperty("reboot")) {
|
||||
|
|
Loading…
Reference in a new issue