added second top row
This commit is contained in:
@@ -9,12 +9,6 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
||||
|
||||
$scope.nodesTotal = 0;
|
||||
$scope.nodesActive = 0;
|
||||
$scope.bestBlockObject = {
|
||||
number: 0,
|
||||
hash: "0x?",
|
||||
transactions: [],
|
||||
uncles: []
|
||||
}
|
||||
$scope.bestBlock = 0;
|
||||
$scope.lastBlock = 0;
|
||||
$scope.lastDifficulty = 0;
|
||||
@@ -219,12 +213,11 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
||||
|
||||
var bestBlock = _.max($scope.nodes, function(node) {
|
||||
return parseInt(node.stats.block.number);
|
||||
}).stats.block;
|
||||
}).stats.block.number;
|
||||
|
||||
if(bestBlock.number > $scope.bestBlock)
|
||||
if(bestBlock > $scope.bestBlock)
|
||||
{
|
||||
$scope.bestBlockObject = bestBlock;
|
||||
$scope.bestBlock = bestBlock.number;
|
||||
$scope.bestBlock = bestBlock;
|
||||
$scope.bestStats = _.max($scope.nodes, function(node) {
|
||||
return parseInt(node.stats.block.number);
|
||||
}).stats;
|
||||
@@ -245,7 +238,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
||||
jQuery('.spark-gasspending').sparkline($scope.gasSpending.reverse(), {type: 'bar'});
|
||||
}
|
||||
|
||||
$scope.lastDifficulty = $scope.bestBlockObject.difficulty;
|
||||
$scope.lastDifficulty = $scope.bestStats.block.difficulty;
|
||||
|
||||
$scope.avgBlockTime = _.max($scope.nodes, function(node) {
|
||||
return parseInt(node.stats.block.number);
|
||||
|
||||
@@ -60,19 +60,9 @@ angular.module('netStatsApp.directives', []).
|
||||
|
||||
scope.init();
|
||||
|
||||
window.onresize = function() {
|
||||
scope.$apply();
|
||||
};
|
||||
|
||||
scope.$watch('data', function() {
|
||||
scope.map.bubbles(scope.data, bubbleConfig);
|
||||
}, true);
|
||||
|
||||
scope.$watch(function() {
|
||||
return angular.element(window)[0].innerWidth;
|
||||
}, function() {
|
||||
scope.init();
|
||||
});
|
||||
}
|
||||
};
|
||||
}]).
|
||||
|
||||
@@ -100,6 +100,32 @@ angular.module('netStatsApp.filters', [])
|
||||
return (best - current.block.number <= 1 ? 'text-success' : (best - current.block.number > 1 && best - current.block.number < 4 ? 'text-warning' : 'text-danger'));
|
||||
};
|
||||
})
|
||||
.filter('gasPriceFilter', ['$filter', function(filter) {
|
||||
var numberFilter = filter('number')
|
||||
return function(price) {
|
||||
console.log("--------------------");
|
||||
console.log(price.length);
|
||||
if(price.length < 4)
|
||||
return price + " wei";
|
||||
|
||||
if(price.length < 7)
|
||||
return (price/1000) + " kwei";
|
||||
|
||||
if(price.length < 10)
|
||||
return (price/1000000) + " mwei";
|
||||
|
||||
if(price.length < 13)
|
||||
return (price/1000000000) + " gwei";
|
||||
|
||||
if(price.length < 16)
|
||||
return (price/1000000000000) + " szabo";
|
||||
|
||||
if(price.length < 19)
|
||||
return (price.substr(0, price.length - 15)) + " finney";
|
||||
|
||||
return numberFilter(price.substr(0, price.length - 18)) + " ether";
|
||||
}
|
||||
}])
|
||||
.filter('gasFilter', function() {
|
||||
return function(gas) {
|
||||
return (typeof gas !== 'undefined' ? parseInt(gas) : '?');
|
||||
|
||||
Reference in New Issue
Block a user