fixed blocktime and blocktimeAvg
This commit is contained in:
@@ -117,7 +117,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
||||
|
||||
$scope.lastBlock = _.max($scope.nodes, function(node) {
|
||||
return parseInt(node.stats.block.timestamp);
|
||||
}).stats.block.timestamp;
|
||||
}).stats.block.blocktime;
|
||||
|
||||
$scope.lastDifficulty = _.max($scope.nodes, function(node) {
|
||||
return parseInt(node.stats.block.timestamp);
|
||||
|
||||
@@ -44,7 +44,9 @@ angular.module('netStatsApp.filters', [])
|
||||
version = version.replace('eth version ', 'v')
|
||||
.replace("\n" + 'Network protocol version: ', ' (')
|
||||
.replace("\n" + 'Client database version: ', ',')
|
||||
.replace("\n" + 'Build: ', ') - ');
|
||||
.replace("\n" + 'Build: ', ') - ')
|
||||
.replace('/Debug', '')
|
||||
.replace('/.', '');
|
||||
return $sce.trustAsHtml(version);
|
||||
};
|
||||
})
|
||||
@@ -63,9 +65,16 @@ angular.module('netStatsApp.filters', [])
|
||||
return timeClass(timestamp);
|
||||
};
|
||||
})
|
||||
.filter('avgTimeFilter', function() {
|
||||
.filter('blockTimeFilter', function() {
|
||||
return function(time) {
|
||||
return Math.round(time) + 's';
|
||||
if(time === 0)
|
||||
return '∞';
|
||||
|
||||
return moment.duration(Math.round(time), 's').humanize() + ' ago';
|
||||
};
|
||||
}).filter('avgTimeFilter', function() {
|
||||
return function(time) {
|
||||
return moment.duration(Math.round(time), 's').humanize();
|
||||
};
|
||||
})
|
||||
.filter('avgTimeClass', function() {
|
||||
|
||||
@@ -3,5 +3,11 @@
|
||||
$(this).tooltip('show');
|
||||
}).on('mouseleave', '[data-toggle="tooltip"]', function( event ) {
|
||||
$(this).tooltip('hide');
|
||||
})
|
||||
});
|
||||
|
||||
moment.relativeTimeTreshold('s', 60);
|
||||
moment.relativeTimeTreshold('m', 60);
|
||||
moment.relativeTimeTreshold('h', 24);
|
||||
moment.relativeTimeTreshold('d', 28);
|
||||
moment.relativeTimeTreshold('M', 12);
|
||||
})();
|
||||
Reference in New Issue
Block a user