Improved IP geolocation ui.

Ylian Saint-Hilaire committed Jan 31, 2019 at 15:21 UTC 315adef695616ee80f3da80eeee7a9414a838416
1 file changed +8 -10
views/default.handlebars
+8 -10
@@ -1276,18 +1276,16 @@
1276 QH('d2netinfo', 'No network interface information available for this device.');
1277 } else {
1278 var x = '<div style=width:100%;max-height:260px;overflow-x:hidden;overflow-y:auto;line-height:160%>';
1279 - if (currentNode.publicip) {
1280 - x += addHtmlValue2('Public IP address', currentNode.publicip);
1281 - } else {
1282 - if (currentNode.lastconnect) { x += addHtmlValue2('Last agent connection', new Date(currentNode.lastconnect).toLocaleString()); }
1283 - if (currentNode.lastaddr) {
1284 - if (isPrivateIP(currentNode.lastaddr)) {
1285 - x += addHtmlValue2('Last agent address:port', currentNode.lastaddr);
1286 - } else {
1287 - x += addHtmlValue2('Last agent address:port', '<a href="https://iplocation.com/?ip=' + currentNode.lastaddr.split(':')[0] + '" rel="noreferrer noopener" target=_blank>' + currentNode.lastaddr + '</a>');
1288 - }
1279 +
1280 + if (currentNode.lastconnect) { x += addHtmlValue2('Last agent connection', new Date(currentNode.lastconnect).toLocaleString()); }
1281 + if (currentNode.lastaddr) {
1282 + if (isPrivateIP(currentNode.lastaddr)) {
1283 + x += addHtmlValue2('Last agent address', currentNode.lastaddr.split(':')[0]);
1284 + } else {
1285 + x += addHtmlValue2('Last agent address', '<a href="https://iplocation.com/?ip=' + currentNode.lastaddr.split(':')[0] + '" rel="noreferrer noopener" target=_blank>' + currentNode.lastaddr.split(':')[0] + '</a>');
1286 }
1287 }
1288 +
1289 x += addHtmlValue2('Last interfaces update', new Date(message.updateTime).toLocaleString());
1290 for (var i in message.netif) {
1291 var net = message.netif[i];