commit
a53c339468
@ -203,11 +203,68 @@ angular.module('netStatsApp.filters', [])
|
||||
};
|
||||
})
|
||||
.filter('geoTooltip', function() {
|
||||
return function(geo) {
|
||||
if(geo !== null)
|
||||
return geo.city + ", " + geo.country;
|
||||
return function(node) {
|
||||
var tooltip = [];
|
||||
var string = '';
|
||||
|
||||
return '';
|
||||
if(node.geo !== null)
|
||||
{
|
||||
string = "Location: <b>";
|
||||
|
||||
if(node.geo.city !== '')
|
||||
string += node.geo.city + ", ";
|
||||
string += node.geo.country + "</b>";
|
||||
|
||||
tooltip.push(string);
|
||||
}
|
||||
|
||||
if(node.info.contact !== '') {
|
||||
string = "Contact: <b>" + node.info.contact + "</b>";
|
||||
|
||||
tooltip.push(string);
|
||||
}
|
||||
|
||||
if(node.info.node !== '') {
|
||||
var eth_version = node.info.node.split('/');
|
||||
|
||||
if(eth_version[1][0] !== 'v' && eth_version[1][2] !== '.')
|
||||
{
|
||||
eth_version.splice(1,1);
|
||||
}
|
||||
|
||||
string = "Ethereum: <b>" + (eth_version[0]) + "</b>";
|
||||
|
||||
tooltip.push(string);
|
||||
|
||||
string = "Version: <b>" + (eth_version[1]) + "</b>";
|
||||
tooltip.push(string);
|
||||
}
|
||||
|
||||
if(node.info.net !== '') {
|
||||
string = "Network: <b>" + node.info.net + "</b>";
|
||||
|
||||
tooltip.push(string);
|
||||
}
|
||||
|
||||
if(node.info.protocol !== '') {
|
||||
string = "Protocol: <b>" + node.info.protocol + "</b>";
|
||||
|
||||
tooltip.push(string);
|
||||
}
|
||||
|
||||
if(node.info.api !== '') {
|
||||
string = "Web3: <b>" + node.info.api + "</b>";
|
||||
|
||||
tooltip.push(string);
|
||||
}
|
||||
|
||||
if(node.info.client !== '') {
|
||||
string = "API: <b>" + node.info.client + "</b>";
|
||||
|
||||
tooltip.push(string);
|
||||
}
|
||||
|
||||
return tooltip.join("<br>");
|
||||
};
|
||||
})
|
||||
.filter('bubbleClass', function() {
|
||||
|
@ -135,8 +135,8 @@ block content
|
||||
tbody
|
||||
tr(ng-repeat='node in nodes | orderBy:predicate:reverse', class="{{ node.stats | mainClass : bestBlock }}")
|
||||
td(rel="{{node.id}}")
|
||||
span.small(data-toggle="tooltip", data-placement="top", data-original-title="{{node.geo | geoTooltip}}") {{node.info.name}}
|
||||
span.small #[ ]({{node.info.ip}})
|
||||
span.small(data-toggle="tooltip", data-placement="top", data-html="true", data-original-title="{{node | geoTooltip}}") {{node.info.name}}
|
||||
span.small #[ ]({{node.info.ip}}:{{node.info.port || 30303}})
|
||||
td
|
||||
div.small(ng-bind-html="node.info.node | nodeVersion")
|
||||
//- div.small {{node.info.os}}, {{node.info.os_v}}
|
||||
|
Loading…
Reference in New Issue
Block a user