diff --git a/public/js/filters.js b/public/js/filters.js index 456448a..38adac5 100644 --- a/public/js/filters.js +++ b/public/js/filters.js @@ -175,17 +175,20 @@ angular.module('netStatsApp.filters', []) }; }) .filter('propagationAvgTimeClass', function() { - return function(propagation) { - if(propagation == 0) + return function(stats) { + if( ! stats.active) + return 'text-gray'; + + if(stats.propagationAvg == 0) return 'text-info'; - if(propagation < 1000) + if(stats.propagationAvg < 1000) return 'text-success'; - if(propagation < 3000) + if(stats.propagationAvg < 3000) return 'text-warning'; - if(propagation < 7000) + if(stats.propagationAvg < 7000) return 'text-orange'; return 'text-danger' diff --git a/views/index.jade b/views/index.jade index 67bb36f..25116e6 100644 --- a/views/index.jade +++ b/views/index.jade @@ -205,5 +205,5 @@ block content div.propagationBox span {{node.stats.block.propagation | blockPropagationFilter}} td.peerPropagationChart(class="{{node.id}}") - td(class="{{ node.stats.propagationAvg | propagationAvgTimeClass }}") {{ node.stats.propagationAvg | blockPropagationFilter }} + td(class="{{ node.stats | propagationAvgTimeClass }}") {{ node.stats.propagationAvg | blockPropagationFilter }} td(class="{{ node.stats.uptime | upTimeClass : node.stats.active }}") {{ node.stats.uptime | upTimeFilter }}