From e5769c4b5892abb8b2d02a86fe79872da37b02c6 Mon Sep 17 00:00:00 2001 From: Marian Oancea Date: Mon, 9 Feb 2015 01:09:41 +0200 Subject: [PATCH] added os in config --- config/nodes.default.js | 4 ++++ models/node.js | 13 ++++++++++--- views/index.jade | 3 ++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/config/nodes.default.js b/config/nodes.default.js index 2b3a903..284bd59 100644 --- a/config/nodes.default.js +++ b/config/nodes.default.js @@ -13,24 +13,28 @@ var nodes = [ { name: 'instance 1', type: 'C++', + os: 'linux', rpcHost: '54.173.252.182', rpcPort: '8080' }, { name: 'instance 2', type: 'C++', + os: 'linux', rpcHost: '54.209.133.248', rpcPort: '8080' }, { name: 'instance 3', type: 'C++', + os: 'linux', rpcHost: '54.174.67.126', rpcPort: '8080' }, { name: 'local', type: 'C++', + os: 'OS X', rpcHost: 'localhost', rpcPort: '8080' } diff --git a/models/node.js b/models/node.js index 58c083f..30ba886 100644 --- a/models/node.js +++ b/models/node.js @@ -4,8 +4,15 @@ require('es6-promise').polyfill(); var Node = function Node(options, id) { - this.info = options; - this.info.geo = geoip.lookup(this.info.rpcHost); + this.options = options; + this.info = { + name: options.name, + ip: options.rpcHost, + type: options.type, + os: options.os + }; + + this.info.geo = geoip.lookup(this.info.ip); this.info.id = parseInt(id); this.info.stats = { active: false, @@ -30,7 +37,7 @@ var Node = function Node(options, id) Node.prototype.update = function() { - var sock = new this.web3.providers.HttpSyncProvider('http://' + this.info.rpcHost + ':' + this.info.rpcPort); + var sock = new this.web3.providers.HttpSyncProvider('http://' + this.options.rpcHost + ':' + this.options.rpcPort); this.web3.setProvider(sock); var eth = this.web3.eth; diff --git a/views/index.jade b/views/index.jade index cc29454..744cc1c 100644 --- a/views/index.jade +++ b/views/index.jade @@ -76,8 +76,9 @@ block content tr(ng-repeat='node in nodes', class="{{ node.stats | mainClass : bestBlock }}") td(rel="{{node.id}}") span(data-toggle="tooltip", data-placement="top", data-original-title="{{node.geo | geoTooltip}}") {{node.name}} - div.small {{node.rpcHost}} + div.small {{node.ip}} td {{node.type}} + div.small {{node.os}} td(class="{{ node.stats.peers | peerClass }}") {{node.stats.peers}} td(class="{{ node.stats.mining | miningClass }}") i(class="{{ node.stats.mining | miningIconClass }}")