added current block uncle count
This commit is contained in:
parent
735096be93
commit
5429e43c96
@ -23,7 +23,8 @@ var Node = function Node(data)
|
|||||||
arrival: 0,
|
arrival: 0,
|
||||||
propagation: 0,
|
propagation: 0,
|
||||||
received: 0,
|
received: 0,
|
||||||
transactions: []
|
transactions: [],
|
||||||
|
uncles: []
|
||||||
},
|
},
|
||||||
blocktimeAvg: 0,
|
blocktimeAvg: 0,
|
||||||
blockTimes: [],
|
blockTimes: [],
|
||||||
|
@ -115,8 +115,11 @@ div.small-title-miner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
span.small-title span.small {
|
span.small-title span.small {
|
||||||
letter-spacing: 0px;
|
font-size: 11px;
|
||||||
|
letter-spacing: -.5px;
|
||||||
color: #666;
|
color: #666;
|
||||||
|
-webkit-font-smoothing: subpixel-antialiased;
|
||||||
|
-moz-font-smoothing: subpixel-antialiased;
|
||||||
}
|
}
|
||||||
|
|
||||||
.big-info .big-details {
|
.big-info .big-details {
|
||||||
|
@ -9,6 +9,12 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
|
|
||||||
$scope.nodesTotal = 0;
|
$scope.nodesTotal = 0;
|
||||||
$scope.nodesActive = 0;
|
$scope.nodesActive = 0;
|
||||||
|
$scope.bestBlockObject = {
|
||||||
|
number: 0,
|
||||||
|
hash: "0x?",
|
||||||
|
transactions: [],
|
||||||
|
uncles: []
|
||||||
|
}
|
||||||
$scope.bestBlock = 0;
|
$scope.bestBlock = 0;
|
||||||
$scope.lastBlock = 0;
|
$scope.lastBlock = 0;
|
||||||
$scope.lastDifficulty = 0;
|
$scope.lastDifficulty = 0;
|
||||||
@ -18,7 +24,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
$scope.bestStats = {};
|
$scope.bestStats = {};
|
||||||
|
|
||||||
$scope.lastBlocksTime = [];
|
$scope.lastBlocksTime = [];
|
||||||
$scope.difficultyChange = [];
|
$scope.difficultyChart = [];
|
||||||
$scope.transactionDensity = [];
|
$scope.transactionDensity = [];
|
||||||
$scope.gasSpending = [];
|
$scope.gasSpending = [];
|
||||||
$scope.miners = [];
|
$scope.miners = [];
|
||||||
@ -213,18 +219,19 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
|
|
||||||
var bestBlock = _.max($scope.nodes, function(node) {
|
var bestBlock = _.max($scope.nodes, function(node) {
|
||||||
return parseInt(node.stats.block.number);
|
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) {
|
$scope.bestStats = _.max($scope.nodes, function(node) {
|
||||||
return parseInt(node.stats.block.number);
|
return parseInt(node.stats.block.number);
|
||||||
}).stats;
|
}).stats;
|
||||||
|
|
||||||
$scope.lastBlock = $scope.bestStats.block.received;
|
$scope.lastBlock = $scope.bestStats.block.received;
|
||||||
$scope.lastBlocksTime = $scope.bestStats.blockTimes;
|
$scope.lastBlocksTime = $scope.bestStats.blockTimes;
|
||||||
$scope.difficultyChange = $scope.bestStats.difficulty;
|
$scope.difficultyChart = $scope.bestStats.difficulty;
|
||||||
$scope.transactionDensity = $scope.bestStats.txDensity;
|
$scope.transactionDensity = $scope.bestStats.txDensity;
|
||||||
$scope.gasSpending = $scope.bestStats.gasSpending;
|
$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-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-transactions').sparkline($scope.transactionDensity.reverse(), {type: 'bar'});
|
||||||
jQuery('.spark-gasspending').sparkline($scope.gasSpending.reverse(), {type: 'bar'});
|
jQuery('.spark-gasspending').sparkline($scope.gasSpending.reverse(), {type: 'bar'});
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.lastDifficulty = _.max($scope.nodes, function(node) {
|
$scope.lastDifficulty = $scope.bestBlockObject.difficulty;
|
||||||
return parseInt(node.stats.block.number);
|
|
||||||
}).stats.block.difficulty;
|
|
||||||
|
|
||||||
$scope.avgBlockTime = _.max($scope.nodes, function(node) {
|
$scope.avgBlockTime = _.max($scope.nodes, function(node) {
|
||||||
return parseInt(node.stats.block.number);
|
return parseInt(node.stats.block.number);
|
||||||
|
@ -15,13 +15,13 @@ block content
|
|||||||
span.big-details {{nodesActive}}/{{nodesTotal}}
|
span.big-details {{nodesActive}}/{{nodesTotal}}
|
||||||
div.clearfix
|
div.clearfix
|
||||||
div.col-xs-2.stat-holder
|
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
|
div.pull-left.icon-full-width
|
||||||
i.icon-uncle
|
i.icon-uncle
|
||||||
div.pull-left
|
div.pull-left
|
||||||
span.small-title uncles #[ ]
|
span.small-title uncles #[ ]
|
||||||
span.small (last 50 blocks)
|
span.small (current / last 50)
|
||||||
span.big-details {{ uncleCount }}
|
span.big-details {{ bestBlockObject.uncles.length + "/" + uncleCount }}
|
||||||
div.clearfix
|
div.clearfix
|
||||||
//- div.col-xs-2.stat-holder
|
//- div.col-xs-2.stat-holder
|
||||||
//- div.big-info.uptime(class="{{ upTimeTotal | upTimeClass : true }}")
|
//- div.big-info.uptime(class="{{ upTimeTotal | upTimeClass : true }}")
|
||||||
|
Loading…
Reference in New Issue
Block a user