added node latency

This commit is contained in:
cubedro
2015-02-23 15:57:41 +02:00
parent 76de55f2e5
commit 6c17d0ee9c
5 changed files with 20 additions and 2 deletions

View File

@@ -60,6 +60,14 @@ 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);
@@ -79,7 +87,7 @@ angular.module('netStatsApp.filters', [])
var diff = time - timestamp;
if(diff < 60)
return Math.round(diff) + ' s';
return Math.round(diff) + ' s ago';
return moment.duration(Math.round(diff), 's').humanize() + ' ago';
};