Permalink
Browse files

final touches on master node count

  • Loading branch information...
Alan Rudolf
Alan Rudolf committed Sep 9, 2017
1 parent d052e73 commit 0c72511966bed245c3e2422fa71fad2ede65dd37
Showing with 16 additions and 7 deletions.
  1. +1 −1 package.json
  2. +5 −0 public/stylesheets/style.css
  3. +3 −3 routes/index.js
  4. +7 −3 views/layout.jade
View
@@ -15,7 +15,7 @@
"body-parser": "~1.0.0",
"debug": "~0.7.4",
"jade": "~1.3.0",
"chaincoin-node-api": "1.0.2",
"chaincoin-node-api": "1.0.1",
"request": "2.74.0",
"jsonminify": "0.2.3",
"mongodb": "2.0.45",
@@ -129,6 +129,11 @@ tr {
margin-bottom: 5px;
}
#masternodepanel span{
margin: 0 5px 0 5px;
top: 0;
}
.label a:link {
color: #ffffff;
}
View
@@ -4,7 +4,6 @@ var express = require('express')
, locale = require('../lib/locale')
, db = require('../lib/database')
, lib = require('../lib/explorer')
, masternodes = require('../lib/masternodes')
, qr = require('qr-image');
function route_get_block(res, blockhash) {
@@ -297,22 +296,23 @@ router.get('/ext/summary', function(req, res) {
}
lib.get_hashrate(function(hashrate) {
lib.get_connectioncount(function(connections){
lib.get_masternodecount(function(masternodes){
lib.get_masternodecount(function(masternodestotal){
lib.get_masternodecountonline(function(masternodesonline){
lib.get_blockcount(function(blockcount) {
db.get_stats(settings.coin, function (stats) {
if (hashrate == 'There was an error. Check your console.') {
hashrate = 0;
}
var masternodesoffline = Math.floor(masternodestotal - masternodesonline);
res.send({ data: [{
difficulty: difficulty,
difficultyHybrid: difficultyHybrid,
supply: stats.supply,
hashrate: hashrate,
lastPrice: stats.last_price,
connections: connections,
masternodeCount: masternodes,
masternodeCountOnline: masternodesonline,
masternodeCountOffline: masternodesoffline,
blockcount: blockcount
}]});
});
View
@@ -27,8 +27,8 @@ html
function update_stats(){
$.ajax({url: '/ext/summary', success: function(json){
$("#supply").text(json.data[0].supply);
$("#masternodeCount").text(json.data[0].masternodeCount);
$("#masternodeCountOnline").text(json.data[0].masternodeCountOnline);
$("#masternodeCountOffline").text(json.data[0].masternodeCountOffline);
$("#difficulty").text(json.data[0].difficulty);
$("#difficultyHybrid").text(json.data[0].difficultyHybrid);
$("#hashrate").text(json.data[0].hashrate);
@@ -175,8 +175,12 @@ html
.panel-heading
strong #{settings.locale.masternodecount}
.panel-body
label#masternodeCount
label#masternodeCountOnline -
#masternodepanel
span.glyphicon.fa.fa-exclamation-triangle
label#masternodeCountOffline -
label  / 
label#masternodeCountOnline -
span.glyphicon.fa.fa-check-circle
.col-md-2
.panel.panel-default.hidden-sm.hidden-xs
.panel-heading

0 comments on commit 0c72511

Please sign in to comment.