more filters
This commit is contained in:
parent
3dd2e34371
commit
a3968373c0
@ -3,6 +3,17 @@
|
||||
/* Filters */
|
||||
|
||||
angular.module('netStatsApp.filters', [])
|
||||
.filter('mainClass', function() {
|
||||
return function(node, bestBlock) {
|
||||
if( ! node.active)
|
||||
return 'text-danger';
|
||||
|
||||
if( node.peers === 0)
|
||||
return 'text-danger';
|
||||
|
||||
return (node.peers <= 1 ? 'text-danger' : (node.peers > 1 && node.peers < 4 ? 'text-warning' : 'text-success'));
|
||||
}
|
||||
})
|
||||
.filter('peerClass', function() {
|
||||
return function(peers) {
|
||||
return (peers <= 1 ? 'text-danger' : (peers > 1 && peers < 4 ? 'text-warning' : 'text-success'));
|
||||
|
@ -73,7 +73,7 @@ block content
|
||||
th
|
||||
i.icon-clock
|
||||
tbody
|
||||
tr(ng-repeat='node in nodes', class="{{ node.stats.active ? 'text-success' : 'text-danger' }}")
|
||||
tr(ng-repeat='node in nodes', class="{{ node.stats | mainClass : bestBlock }}")
|
||||
td(rel="{{node.id}}") {{node.name}}
|
||||
td {{node.type}}
|
||||
td(class="{{ node.stats.peers | peerClass }}") {{node.stats.peers}}
|
||||
|
Loading…
Reference in New Issue
Block a user