added visible node IP

This commit is contained in:
Marian Oancea 2015-02-08 23:00:51 +02:00
parent 4da9cf8427
commit 8f7c3ea2b6
2 changed files with 5 additions and 1 deletions

View File

@ -12,7 +12,7 @@ var Node = function Node(options, id)
peers: 0, peers: 0,
mining: false, mining: false,
block: { block: {
height: 0, number: 0,
hash: '?', hash: '?',
timestamp: 0 timestamp: 0
}, },
@ -44,6 +44,9 @@ Node.prototype.update = function()
if(this.info.stats.peers != null) { if(this.info.stats.peers != null) {
this.info.stats.block = eth.block(parseInt(eth.number)); this.info.stats.block = eth.block(parseInt(eth.number));
if(this.info.stats.block.hash != '?'){
this.info.stats.block.difficulty = this.web3.toDecimal(this.info.stats.block.difficulty);
}
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

@ -76,6 +76,7 @@ block content
tr(ng-repeat='node in nodes', class="{{ node.stats | mainClass : bestBlock }}") tr(ng-repeat='node in nodes', class="{{ node.stats | mainClass : bestBlock }}")
td(rel="{{node.id}}") td(rel="{{node.id}}")
span(data-toggle="tooltip", data-placement="top", data-original-title="{{node.geo | geoTooltip}}") {{node.name}} span(data-toggle="tooltip", data-placement="top", data-original-title="{{node.geo | geoTooltip}}") {{node.name}}
div.small {{node.rpcHost}}
td {{node.type}} td {{node.type}}
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 }}")