poa: show staking check icon instead of non existent hashrate

This commit is contained in:
Peter Grassberger 2019-02-18 20:16:02 +01:00
parent 01779e3133
commit 95b35698d8
2 changed files with 9 additions and 2 deletions

View File

@ -75,6 +75,13 @@ angular.module('netStatsApp.filters', [])
return $sce.trustAsHtml('<span class="small">' + filter('number')(result.toFixed(1)) + ' <span class="small-hash">' + unit + 'H/s</span></span>');
};
}])
.filter('stakingFilter', ['$sce', '$filter', function($sce, filter) {
return function(hashes, isMining) {
if( !isMining )
return $sce.trustAsHtml('<i class="icon-cancel"></i>');
return $sce.trustAsHtml('<i class="icon-check"></i>');
};
}])
.filter('totalDifficultyFilter', function() {
return function(hashes) {
var result = hashes;

View File

@ -110,7 +110,7 @@ block content
th.th-latency
i.icon-clock(data-toggle="tooltip", data-placement="top", title="Node latency", ng-click="orderTable(['stats.latency'], false)")
th
i.icon-mining(data-toggle="tooltip", data-placement="top", title="Is mining", ng-click="orderTable(['-stats.hashrate'], false)")
i.icon-mining(data-toggle="tooltip", data-placement="top", title="Is staking", ng-click="orderTable(['-stats.hashrate'], false)")
th
i.icon-group(data-toggle="tooltip", data-placement="top", title="Peers", ng-click="orderTable(['-stats.peers'], false)")
th
@ -146,7 +146,7 @@ block content
div.small(ng-bind-html="node.info.node | nodeVersion")
td(class="{{ node.readable.latencyClass }}")
span.small {{ node.readable.latency }}
td(class="{{ node.stats.mining | hashrateClass : node.stats.active }}", ng-bind-html="node.stats.hashrate | hashrateFilter : node.stats.mining")
td(class="{{ node.stats.mining | hashrateClass : node.stats.active }}", ng-bind-html="node.stats.hashrate | stakingFilter : node.stats.mining")
td(class="{{ node.stats.peers | peerClass : node.stats.active }}", style="padding-left: 11px;") {{node.stats.peers}}
td(style="padding-left: 15px;") {{node.stats.pending}}
td(class="{{ node.stats | blockClass : bestBlock }}")