added current block uncle count

This commit is contained in:
cubedro 2015-04-24 08:37:03 +03:00
parent 735096be93
commit 5429e43c96
4 changed files with 23 additions and 14 deletions

View File

@ -23,7 +23,8 @@ var Node = function Node(data)
arrival: 0,
propagation: 0,
received: 0,
transactions: []
transactions: [],
uncles: []
},
blocktimeAvg: 0,
blockTimes: [],

View File

@ -115,8 +115,11 @@ div.small-title-miner {
}
span.small-title span.small {
letter-spacing: 0px;
font-size: 11px;
letter-spacing: -.5px;
color: #666;
-webkit-font-smoothing: subpixel-antialiased;
-moz-font-smoothing: subpixel-antialiased;
}
.big-info .big-details {

View File

@ -9,6 +9,12 @@ 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;
@ -18,7 +24,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
$scope.bestStats = {};
$scope.lastBlocksTime = [];
$scope.difficultyChange = [];
$scope.difficultyChart = [];
$scope.transactionDensity = [];
$scope.gasSpending = [];
$scope.miners = [];
@ -213,18 +219,19 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
var bestBlock = _.max($scope.nodes, function(node) {
return parseInt(node.stats.block.number);
}).stats.block.number;
}).stats.block;
if(bestBlock > $scope.bestBlock)
if(bestBlock.number > $scope.bestBlock)
{
$scope.bestBlock = bestBlock;
$scope.bestBlockObject = bestBlock;
$scope.bestBlock = bestBlock.number;
$scope.bestStats = _.max($scope.nodes, function(node) {
return parseInt(node.stats.block.number);
}).stats;
$scope.lastBlock = $scope.bestStats.block.received;
$scope.lastBlocksTime = $scope.bestStats.blockTimes;
$scope.difficultyChange = $scope.bestStats.difficulty;
$scope.difficultyChart = $scope.bestStats.difficulty;
$scope.transactionDensity = $scope.bestStats.txDensity;
$scope.gasSpending = $scope.bestStats.gasSpending;
@ -233,14 +240,12 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
}
jQuery('.spark-blocktimes').sparkline($scope.lastBlocksTime.reverse(), {type: 'bar', tooltipSuffix: ' s'});
jQuery('.spark-difficulty').sparkline($scope.difficultyChange.reverse(), {type: 'bar'});
jQuery('.spark-difficulty').sparkline($scope.difficultyChart.reverse(), {type: 'bar'});
jQuery('.spark-transactions').sparkline($scope.transactionDensity.reverse(), {type: 'bar'});
jQuery('.spark-gasspending').sparkline($scope.gasSpending.reverse(), {type: 'bar'});
}
$scope.lastDifficulty = _.max($scope.nodes, function(node) {
return parseInt(node.stats.block.number);
}).stats.block.difficulty;
$scope.lastDifficulty = $scope.bestBlockObject.difficulty;
$scope.avgBlockTime = _.max($scope.nodes, function(node) {
return parseInt(node.stats.block.number);

View File

@ -15,13 +15,13 @@ block content
span.big-details {{nodesActive}}/{{nodesTotal}}
div.clearfix
div.col-xs-2.stat-holder
div.big-info.uncleCount(class="{{ uncleCount | upTimeClass : true }}")
div.big-info.uncleCount.text-info
div.pull-left.icon-full-width
i.icon-uncle
div.pull-left
span.small-title uncles #[ ]
span.small (last 50 blocks)
span.big-details {{ uncleCount }}
span.small (current / last 50)
span.big-details {{ bestBlockObject.uncles.length + "/" + uncleCount }}
div.clearfix
//- div.col-xs-2.stat-holder
//- div.big-info.uptime(class="{{ upTimeTotal | upTimeClass : true }}")