added location tooltip
This commit is contained in:
parent
81ce05ca1a
commit
11158060bf
@ -25,6 +25,5 @@ function StatsCtrl($scope, socket, _) {
|
||||
$scope.nodesActive = _.filter($scope.nodes, function(node){ return node.stats.active == true; }).length;
|
||||
$scope.bestBlock = _.max($scope.nodes, function(node){ return parseInt(node.stats.block.height); }).stats.block.height;
|
||||
$scope.lastBlock = _.max($scope.nodes, function(node){ return parseInt(node.stats.block.timestamp); }).stats.block.timestamp;
|
||||
$scope.apply();
|
||||
}
|
||||
}
|
@ -54,6 +54,10 @@ angular.module('netStatsApp.filters', [])
|
||||
return function(timestamp) {
|
||||
return timeClass(timestamp);
|
||||
};
|
||||
}).filter('geoTooltip', function() {
|
||||
return function(geo) {
|
||||
return geo.city + ", " + geo.country;
|
||||
};
|
||||
});
|
||||
|
||||
function peerClass(peers)
|
||||
|
@ -80,5 +80,9 @@
|
||||
console.log(data);
|
||||
});
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('body').on('mouseenter', '[data-toggle="tooltip"]', function( event ) {
|
||||
$(this).tooltip('show');
|
||||
}).on('mouseleave', '[data-toggle="tooltip"]', function( event ) {
|
||||
$(this).tooltip('hide');
|
||||
})
|
||||
})();
|
@ -74,7 +74,8 @@ block content
|
||||
i.icon-clock(data-toggle="tooltip", data-placement="top", title="Up-time")
|
||||
tbody
|
||||
tr(ng-repeat='node in nodes', class="{{ node.stats | mainClass : bestBlock }}")
|
||||
td(rel="{{node.id}}") {{node.name}}
|
||||
td(rel="{{node.id}}")
|
||||
span(data-toggle="tooltip", data-placement="top", data-original-title="{{node.geo | geoTooltip}}") {{node.name}}
|
||||
td {{node.type}}
|
||||
td(class="{{ node.stats.peers | peerClass }}") {{node.stats.peers}}
|
||||
td(class="{{ node.stats.mining | miningClass }}")
|
||||
|
Loading…
Reference in New Issue
Block a user