moved popagation to backend fixes #38

This commit is contained in:
cubedro
2015-04-05 00:59:24 +03:00
parent 19646a71a7
commit ff5d8bd31a
5 changed files with 44 additions and 16 deletions

View File

@@ -76,11 +76,11 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
case "update":
var index = findIndex({id: data.id});
if(data.stats.block.number > $scope.nodes[index].stats.block.number) {
data.stats.block.firstarrived = (data.stats.block.number > $scope.bestBlock ? data.stats.block.received : $scope.lastBlock);
} else {
data.stats.block.firstarrived = $scope.nodes[index].stats.block.firstarrived;
}
// if(data.stats.block.number > $scope.nodes[index].stats.block.number) {
// data.stats.block.firstarrived = (data.stats.block.number > $scope.bestBlock ? data.stats.block.received : $scope.lastBlock);
// } else {
// data.stats.block.firstarrived = $scope.nodes[index].stats.block.firstarrived;
// }
$scope.nodes[index].stats = data.stats;

View File

@@ -75,9 +75,7 @@ angular.module('netStatsApp.filters', [])
};
})
.filter('propagationTimeClass', function() {
return function(arrival, best) {
var propagation = arrival - best;
return function(propagation) {
if(propagation <= 3000)
return 'text-success';
@@ -125,8 +123,7 @@ angular.module('netStatsApp.filters', [])
};
})
.filter('blockPropagationFilter', function() {
return function(arrival, best) {
var ms = arrival - best;
return function(ms) {
var result = 0;
if(ms < 1000) {