more filters
This commit is contained in:
parent
df87857692
commit
ab72cab4fe
@ -174,6 +174,29 @@ angular.module('netStatsApp.filters', [])
|
||||
return 'text-danger'
|
||||
};
|
||||
})
|
||||
.filter('propagationNodeAvgTimeClass', function() {
|
||||
return function(stats, bestBlock) {
|
||||
if( ! stats.active)
|
||||
return 'text-gray';
|
||||
|
||||
if(stats.block.number < bestBlock)
|
||||
return 'text-gray';
|
||||
|
||||
if(stats.propagationAvg == 0)
|
||||
return 'text-info';
|
||||
|
||||
if(stats.propagationAvg < 1000)
|
||||
return 'text-success';
|
||||
|
||||
if(stats.propagationAvg < 3000)
|
||||
return 'text-warning';
|
||||
|
||||
if(stats.propagationAvg < 7000)
|
||||
return 'text-orange';
|
||||
|
||||
return 'text-danger'
|
||||
};
|
||||
})
|
||||
.filter('propagationAvgTimeClass', function() {
|
||||
return function(propagationAvg, active) {
|
||||
if( ! active)
|
||||
|
@ -206,5 +206,5 @@ block content
|
||||
div.propagationBox
|
||||
span {{node.stats.block.propagation | blockPropagationFilter}}
|
||||
td.peerPropagationChart(class="{{node.id}}")
|
||||
td(class="{{ node.stats.propagationAvg | propagationAvgTimeClass : node.stats.active }}") {{ node.stats.propagationAvg | blockPropagationFilter : '' }}
|
||||
td(class="{{ node.stats | propagationNodeAvgTimeClass : node.stats.active }}") {{ node.stats.propagationAvg | blockPropagationFilter : '' }}
|
||||
td(class="{{ node.stats.uptime | upTimeClass : node.stats.active }}") {{ node.stats.uptime | upTimeFilter }}
|
||||
|
Loading…
Reference in New Issue
Block a user