added peer propagation chart

This commit is contained in:
cubedro
2015-04-06 17:08:36 +03:00
parent 68e7f66f3d
commit 3493a5b2b1
5 changed files with 41 additions and 6 deletions

View File

@@ -229,6 +229,10 @@ table td {
width: 110px;
}
.th-peerPropagationChart {
width: 140px;
}
@media only screen and (max-width: 639px) {
/*.big-info {
padding-bottom: 15px;

View File

@@ -103,7 +103,18 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
break;
case "update":
$scope.nodes[findIndex({id: data.id})].stats = data.stats;
var index = findIndex({id: data.id});
$scope.nodes[index].stats = data.stats;
$scope.nodes[index].history = data.history;
$scope.nodes[index].propagation = _.map(data.history, function(block) {
return block.propagation;
});
jQuery('.' + data.id).sparkline($scope.nodes[index].propagation, {
type: 'bar',
height: 20,
barWidth : 2,
barSpacing : 1,
});
break;
case "info":
@@ -143,6 +154,10 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
}
$scope.nodes[index] = data;
$scope.nodes[index].history = data.history;
$scope.nodes[index].propagation = _.map(data.history, function(block) {
return block.propagation;
});
return false;
}
@@ -211,8 +226,6 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
longitude: 0
};
});
// console.log($scope.map);
}
$scope.$apply();

View File

@@ -71,7 +71,6 @@ angular.module('netStatsApp.filters', [])
})
.filter('timeClass', function() {
return function(timestamp) {
console.log(timestamp);
return timeClass(timestamp);
};
})