[CHANGE] Use n/a for estimates on 0 net hashrate

This commit is contained in:
Sebastian Grewe 2014-04-02 10:46:59 +02:00
parent 7a87c09056
commit 7ef96312bf
6 changed files with 21 additions and 12 deletions

View File

@ -83,7 +83,11 @@ $(document).ready(function(){
$('#b-poolworkers').html(number_format(data.getdashboarddata.data.pool.workers));
$('#b-hashrate').html((number_format(data.getdashboarddata.data.personal.hashrate, 2)));
$('#b-poolhashrate').html(number_format(data.getdashboarddata.data.pool.hashrate, 2));
$('#b-nethashrate').html(number_format(data.getdashboarddata.data.network.hashrate, 2));
if (data.getdashboarddata.data.network.hashrate > 0) {
$('#b-nethashrate').html(number_format(data.getdashboarddata.data.network.hashrate, 2));
} else {
$('#b-nethashrate').html('n/a');
}
$('#b-sharerate').html((parseFloat(data.getdashboarddata.data.personal.sharerate).toFixed(2)));
$('#b-yvalid').html(number_format(data.getdashboarddata.data.personal.shares.valid));
$('#b-yivalid').html(number_format(data.getdashboarddata.data.personal.shares.invalid));
@ -100,8 +104,13 @@ $(document).ready(function(){
$('#b-pefficiency').html(number_format(0, 2) + "%");
}
$('#b-diff').html(number_format(data.getdashboarddata.data.network.difficulty, 8));
$('#b-nextdiff').html(number_format(data.getdashboarddata.data.network.nextdifficulty, 8));
$('#b-nextdiffc').html(" Change in " + data.getdashboarddata.data.network.blocksuntildiffchange + " Blocks");
if (data.getdashboarddata.data.network.hashrate > 0) {
$('#b-nextdiff').html(number_format(data.getdashboarddata.data.network.nextdifficulty, 8));
$('#b-nextdiffc').html(" Change in " + data.getdashboarddata.data.network.blocksuntildiffchange + " Blocks");
} else {
$('#b-nextdiff').html('n/a');
$('#b-nextdiffc').html(' No Estimates');
}
var minutes = Math.floor(data.getdashboarddata.data.network.esttimeperblock / 60);
var seconds = Math.floor(data.getdashboarddata.data.network.esttimeperblock - minutes * 60);
$('#b-esttimeperblock').html(minutes + " minutes " + seconds + " seconds"); // <- this needs some nicer format

View File

@ -78,7 +78,7 @@
<div class="circle-tile-description text-faded">
<p class="h5 up-more">Net Hashrate</p>
<div class="circle-tile-number text-faded up">
<span class="overview" id="b-nethashrate">{$GLOBAL.nethashrate|number_format:"2"}</span>
<span class="overview" id="b-nethashrate">{if $GLOBAL.nethashrate > 0}{$GLOBAL.nethashrate|number_format:"2"}{else}n/a{/if}</span>
<span class="overview-mhs"> {$GLOBAL.hashunits.network}</span>
<br>
<span class="pool-nethashrate-bar spark-18"></span>

View File

@ -78,7 +78,7 @@
<div class="circle-tile-description text-faded">
<p class="h5 up-more">Net Hashrate</p>
<div class="circle-tile-number text-faded up">
<span class="overview" id="b-nethashrate">{$GLOBAL.nethashrate|number_format:"2"}</span>
<span class="overview" id="b-nethashrate">{if $GLOBAL.nethashrate > 0}{$GLOBAL.nethashrate|number_format:"2"}{else}n/a{/if}</span>
<span class="overview-mhs"> {$GLOBAL.hashunits.network}</span>
<br>
<span class="pool-nethashrate-bar spark-18"></span>

View File

@ -67,8 +67,8 @@
</div>
<div class="circle-tile-content lightblue">
<div class="circle-tile-description text-faded">
<p class="h5 up" id="b-nextdiff">{$NETWORK.EstNextDifficulty|number_format:"8"}</p>
<p class="h6" id="b-nextdiffc">Change in {$NETWORK.BlocksUntilDiffChange} Blocks</p>
<p class="h5 up" id="b-nextdiff">{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}</p>
<p class="h6" id="b-nextdiffc">{if $GLOBAL.nethashrate > 0}Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}</p>
</div>
<div class="circle-tile-number text-faded">
<p class="h6 up-more2">Est Next Difficulty</p>

View File

@ -32,7 +32,7 @@
</div>
<div class="col-md-spark">
<i class="fa fa-bar-chart-o fa-flip-horizontal fa-2x"></i>
<p id="b-roundprogress" class="h6 font-bold m-t">{$GLOBAL.userdata.pps.unpaidshares}</p>
<p id="b-unpaidshares" class="h6 font-bold m-t">{$GLOBAL.userdata.pps.unpaidshares}</p>
<p class="h6 text-muted">Unpaid Shares</p>
</div>
<div class="col-md-spark">
@ -42,8 +42,8 @@
</div>
<div class="col-md-spark">
<i class="fa fa-sitemap fa-2x"></i>
<p id="b-nextdiff" class="h5 font-bold m-t">{$NETWORK.EstNextDifficulty|number_format:"8"}</p>
<p id="b-nextdiffc" class="h6 font-bold m-t">Change in {$NETWORK.BlocksUntilDiffChange} Blocks</p>
<p id="b-nextdiff" class="h5 font-bold m-t">{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}</p>
<p id="b-nextdiffc" class="h6 font-bold m-t">{if $GLOBAL.nethashrate > 0}Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}</p>
<p class="h6 text-muted">Est Next Difficulty</p>
</div>
<div class="col-md-spark">

View File

@ -67,8 +67,8 @@
</div>
<div class="circle-tile-content lightblue">
<div class="circle-tile-description text-faded">
<p class="h5 up" id="b-nextdiff">{$NETWORK.EstNextDifficulty|number_format:"8"}</p>
<p class="h6" id="b-nextdiffc">Change in {$NETWORK.BlocksUntilDiffChange} Blocks</p>
<p class="h5 up" id="b-nextdiff">{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}</p>
<p class="h6" id="b-nextdiffc">{if $GLOBAL.nethashrate > 0}Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}</p>
</div>
<div class="circle-tile-number text-faded">
<p class="h6">Est Next Difficulty</p>