moved popagation to backend fixes #38
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user