fixed offline class filter

This commit is contained in:
cubedro
2015-03-27 13:35:23 +02:00
parent 0b94a49ac2
commit f664d55107
2 changed files with 15 additions and 12 deletions

View File

@@ -60,14 +60,6 @@ angular.module('netStatsApp.filters', [])
return (typeof gas !== 'undefined' ? parseInt(gas) : '?');
}
})
.filter('latencyFilter', function() {
return function(stats) {
if(stats.active === false)
return 'offline';
else
return stats.latency + ' ms';
}
})
.filter('hashFilter', function() {
return function(hash) {
return hash.substr(0, 6) + '...' + hash.substr(58, 6);
@@ -89,12 +81,23 @@ angular.module('netStatsApp.filters', [])
return 'text-danger'
};
})
.filter('latencyFilter', function() {
return function(stats) {
if(stats.active === false)
return 'offline';
else
return stats.latency + ' ms';
}
})
.filter('latencyClass', function() {
return function(time) {
if(time <= 100)
return function(stats) {
if(stats.active === false)
return 'text-danger';
if(stats.latency <= 100)
return 'text-success';
if(time <= 1000)
if(stats.latency <= 1000)
return 'text-warning';
return 'text-danger'