Fix display for networks without common name

This commit is contained in:
Kumi 2019-01-17 09:47:41 +01:00
parent 243fe5c6a5
commit edcf42eff7
2 changed files with 2 additions and 2 deletions

View file

@ -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:

View file

@ -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")) {