Improved IP geolocation ui.

This commit is contained in:
Ylian Saint-Hilaire 2019-01-31 15:21:28 -08:00
parent e6ebca7820
commit f7be945aef
1 changed files with 8 additions and 10 deletions

View File

@ -1276,18 +1276,16 @@
QH('d2netinfo', 'No network interface information available for this device.'); QH('d2netinfo', 'No network interface information available for this device.');
} else { } else {
var x = '<div style=width:100%;max-height:260px;overflow-x:hidden;overflow-y:auto;line-height:160%>'; var x = '<div style=width:100%;max-height:260px;overflow-x:hidden;overflow-y:auto;line-height:160%>';
if (currentNode.publicip) {
x += addHtmlValue2('Public IP address', currentNode.publicip);
} else {
if (currentNode.lastconnect) { x += addHtmlValue2('Last agent connection', new Date(currentNode.lastconnect).toLocaleString()); } if (currentNode.lastconnect) { x += addHtmlValue2('Last agent connection', new Date(currentNode.lastconnect).toLocaleString()); }
if (currentNode.lastaddr) { if (currentNode.lastaddr) {
if (isPrivateIP(currentNode.lastaddr)) { if (isPrivateIP(currentNode.lastaddr)) {
x += addHtmlValue2('Last agent address:port', currentNode.lastaddr); x += addHtmlValue2('Last agent address', currentNode.lastaddr.split(':')[0]);
} else { } else {
x += addHtmlValue2('Last agent address:port', '<a href="https://iplocation.com/?ip=' + currentNode.lastaddr.split(':')[0] + '" rel="noreferrer noopener" target=_blank>' + currentNode.lastaddr + '</a>'); 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>');
}
} }
} }
x += addHtmlValue2('Last interfaces update', new Date(message.updateTime).toLocaleString()); x += addHtmlValue2('Last interfaces update', new Date(message.updateTime).toLocaleString());
for (var i in message.netif) { for (var i in message.netif) {
var net = message.netif[i]; var net = message.netif[i];