Merge pull request #212 from cubedro/develop

Lite version
pull/5/head
Marian OANCΞA 9 years ago
commit 3f7d1df582
  1. 2
      dist/index-lite.html
  2. 2
      dist/js/netstats.min.js
  3. 2
      dist/js/netstats.min.js.map
  4. 33
      src/js/filters.js
  5. 10
      src/views/index-lite.jade

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -540,6 +540,39 @@ angular.module('netStatsApp.filters', [])
return 'hidden';
};
})
.filter('consensusClass', function() {
return function(nodes, bestBlock) {
var status = 'success';
var now = _.now();
for(var x = 0; x < nodes.length; x++)
{
if(nodes[x].stats.block.number === bestBlock.number && nodes[x].stats.block.hash !== bestBlock.hash)
return 'danger';
if((bestBlock.number - nodes[x].stats.block.number) > 1 && (now - bestBlock.received) >= 20*1000)
status = 'orange';
if((bestBlock.number - nodes[x].stats.block.number) === 1 && (now - bestBlock.received) >= 10*1000 && status !== 'orange')
status = 'warning';
}
return status;
};
})
.filter('consensusFilter', function() {
return function(nodes, bestBlock) {
var cnt = 0;
for(var x = 0; x < nodes.length; x++)
{
if(nodes[x].stats.block.number === bestBlock.number && nodes[x].stats.block.hash === bestBlock.hash)
cnt++;
}
return cnt + '/' + nodes.length;
};
});
function compareVersions(v1, comparator, v2)

@ -66,10 +66,10 @@ block content
span.small-title active nodes
span.small-value {{nodesActive}}/{{nodesTotal}}
div.col-xs-3.stat-holder.box
div.gasprice.text-info
i.icon-gasprice
span.small-title gas price
span.small-value {{ bestStats.gasPrice.toString() | gasPriceFilter }}
div.gasprice(class="{{ nodes | consensusClass : bestStats }}")
i.icon-check-o
span.small-title nodes status
span.small-value {{ nodes | consensusFilter : bestStats }}
div.col-xs-3.stat-holder.box
div.page-latency(class="{{ {active: true, latency: latency} | latencyClass }}")
i.icon-clock
@ -122,7 +122,7 @@ block content
span.small-title gas spending
sparkchart.big-details.spark-gasspending(data="{{gasSpending.join(',')}}")
div.col-xs-4.stat-holder.map-holder
//- div.col-xs-4.stat-holder.map-holder
nodemap#mapHolder(data="map")
div.row(ng-cloak, style="padding-top: 10px")

Loading…
Cancel
Save