pass whole block info for more data manipulation

This commit is contained in:
Marian Oancea 2015-02-08 17:51:16 +02:00
parent e8b751f591
commit 4da9cf8427
3 changed files with 5 additions and 8 deletions

View File

@ -43,10 +43,7 @@ Node.prototype.update = function()
} }
if(this.info.stats.peers != null) { if(this.info.stats.peers != null) {
this.info.stats.block.height = parseInt(eth.number); this.info.stats.block = eth.block(parseInt(eth.number));
var block = eth.block(this.info.stats.block.height)
this.info.stats.block.hash = block.hash;
this.info.stats.block.timestamp = block.timestamp;
this.info.stats.mining = eth.mining; this.info.stats.mining = eth.mining;
this.info.stats.active = true; this.info.stats.active = true;
} else { } else {

View File

@ -43,8 +43,8 @@ function StatsCtrl($scope, $filter, socket, _) {
}).length; }).length;
$scope.bestBlock = _.max($scope.nodes, function(node) { $scope.bestBlock = _.max($scope.nodes, function(node) {
return parseInt(node.stats.block.height); return parseInt(node.stats.block.number);
}).stats.block.height; }).stats.block.number;
$scope.lastBlock = _.max($scope.nodes, function(node) { $scope.lastBlock = _.max($scope.nodes, function(node) {
return parseInt(node.stats.block.timestamp); return parseInt(node.stats.block.timestamp);

View File

@ -80,8 +80,8 @@ block content
td(class="{{ node.stats.peers | peerClass }}") {{node.stats.peers}} td(class="{{ node.stats.peers | peerClass }}") {{node.stats.peers}}
td(class="{{ node.stats.mining | miningClass }}") td(class="{{ node.stats.mining | miningClass }}")
i(class="{{ node.stats.mining | miningIconClass }}") i(class="{{ node.stats.mining | miningIconClass }}")
td(class="{{ node.stats.block.height | blockClass : bestBlock }}") {{'#' + node.stats.block.height}} td(class="{{ node.stats.block.number | blockClass : bestBlock }}") {{'#' + node.stats.block.number}}
td(class="{{ node.stats.block.height | blockClass : bestBlock }}").hidden-sm.hidden-xs td(class="{{ node.stats.block.number | blockClass : bestBlock }}").hidden-sm.hidden-xs
span.small {{node.stats.block.hash}} span.small {{node.stats.block.hash}}
td(am-time-ago="node.stats.block.timestamp", am-preprocess="unix", class="{{ node.stats.block.timestamp | timeClass }}") ∞ td(am-time-ago="node.stats.block.timestamp", am-preprocess="unix", class="{{ node.stats.block.timestamp | timeClass }}") ∞
td(class="{{ node.stats.uptime.total | upTimeClass }}") {{ node.stats.uptime.total | upTimeFilter }} td(class="{{ node.stats.uptime.total | upTimeClass }}") {{ node.stats.uptime.total | upTimeFilter }}