diff --git a/public/include/pages/api/getnavbardata.inc.php b/public/include/pages/api/getnavbardata.inc.php index 6e05797a..d55ba3dc 100644 --- a/public/include/pages/api/getnavbardata.inc.php +++ b/public/include/pages/api/getnavbardata.inc.php @@ -32,10 +32,26 @@ $statistics->setGetCache(true); $dPoolHashrateAdjusted = $dPoolHashrate * $dPoolHashrateModifier; $dNetworkHashrateAdjusted = $dNetworkHashrate / 1000 * $dNetworkHashrateModifier; +// Use caches for this one +$aRoundShares = $statistics->getRoundShares(); + +$iTotalRoundShares = $aRoundShares['valid'] + $aRoundShares['invalid']; +if ($iTotalRoundShares > 0) { + $dUserInvalidPercent = round($aUserRoundShares['invalid'] / $iTotalRoundShares * 100, 2); + $dPoolInvalidPercent = round($aRoundShares['invalid'] / $iTotalRoundShares * 100, 2); +} else { + $dUserInvalidPercent = 0; + $dPoolInvalidPercent = 0; +} + +// Round progress +$iEstShares = round((65536 * $dDifficulty) / pow(2, ($config['difficulty'] - 16))); +$dEstPercent = round(100 / $iEstShares * $aRoundShares['valid'], 2); + // Output JSON format $data = array( 'raw' => array( 'workers' => $worker->getCountAllActiveWorkers(), 'pool' => array( 'hashrate' => $dPoolHashrate ) ), - 'pool' => array( 'workers' => $worker->getCountAllActiveWorkers(), 'hashrate' => $dPoolHashrateAdjusted ), + 'pool' => array( 'workers' => $worker->getCountAllActiveWorkers(), 'hashrate' => $dPoolHashrateAdjusted, 'estimated' => $iEstShares, 'progress' => $dEstPercent ), 'network' => array( 'hashrate' => $dNetworkHashrateAdjusted, 'difficulty' => $dDifficulty, 'block' => $iBlock ), ); echo $api->get_json($data); diff --git a/public/templates/mpos/dashboard/js.tpl b/public/templates/mpos/dashboard/js.tpl index f8c53fe3..8c4822c2 100644 --- a/public/templates/mpos/dashboard/js.tpl +++ b/public/templates/mpos/dashboard/js.tpl @@ -146,10 +146,11 @@ $(document).ready(function(){ $('#b-sharerate').html((parseFloat(data.getdashboarddata.data.personal.sharerate).toFixed(2))); $('#b-yvalid').html(data.getdashboarddata.data.personal.shares.valid); $('#b-yivalid').html(data.getdashboarddata.data.personal.shares.invalid + " (" + data.getdashboarddata.data.personal.shares.invalid_percent + "%)" ); - $('#b-pvalid').html(data.getdashboarddata.data.pool.shares.valid + " (est: " + data.getdashboarddata.data.pool.shares.progress + "%)"); + $('#b-pvalid').html(data.getdashboarddata.data.pool.shares.valid); $('#b-pivalid').html(data.getdashboarddata.data.pool.shares.invalid + " (" + data.getdashboarddata.data.pool.shares.invalid_percent + "%)" ); $('#b-diff').html(data.getdashboarddata.data.network.difficulty); $('#b-nblock').html(data.getdashboarddata.data.network.block); + $('#b-target').html(data.getdashboarddata.data.pool.shares.estimated + " (done: " + data.getdashboarddata.data.pool.shares.progress + "%)" ); {/literal}{if $GLOBAL.config.payout_system != 'pps'}{literal } $('#b-payout').html((parseFloat(data.getdashboarddata.data.personal.estimates.payout).toFixed(4))); $('#b-block').html((parseFloat(data.getdashboarddata.data.personal.estimates.block).toFixed(4))); diff --git a/public/templates/mpos/dashboard/round_shares.tpl b/public/templates/mpos/dashboard/round_shares.tpl index 5e687b54..de80bbef 100644 --- a/public/templates/mpos/dashboard/round_shares.tpl +++ b/public/templates/mpos/dashboard/round_shares.tpl @@ -1,6 +1,10 @@ Round Shares + + Est. Shares + + Pool Valid diff --git a/public/templates/mpos/statistics/js.tpl b/public/templates/mpos/statistics/js.tpl new file mode 100644 index 00000000..d8111ddd --- /dev/null +++ b/public/templates/mpos/statistics/js.tpl @@ -0,0 +1,30 @@ + diff --git a/public/templates/mpos/statistics/pool/default.tpl b/public/templates/mpos/statistics/pool/default.tpl index 689fb741..4b3e5453 100644 --- a/public/templates/mpos/statistics/pool/default.tpl +++ b/public/templates/mpos/statistics/pool/default.tpl @@ -5,3 +5,5 @@ {include file="statistics/pool/general_stats.tpl"} {include file="statistics/blocks/small_table.tpl" ALIGN="right" SHORT=true} + +{include file="statistics/js.tpl"} diff --git a/public/templates/mpos/statistics/pool/general_stats.tpl b/public/templates/mpos/statistics/pool/general_stats.tpl index 8d3f8500..c8619fe5 100644 --- a/public/templates/mpos/statistics/pool/general_stats.tpl +++ b/public/templates/mpos/statistics/pool/general_stats.tpl @@ -5,7 +5,7 @@ Pool Hash Rate - {($GLOBAL.hashrate)|number_format:"3"} {$GLOBAL.hashunits.pool} + {$GLOBAL.hashunits.pool} Pool Efficiency @@ -13,7 +13,7 @@ Current Active Workers - {$GLOBAL.workers} + {if ! $GLOBAL.website.blockexplorer.disabled} @@ -33,9 +33,9 @@ Current Difficulty {if ! $GLOBAL.website.chaininfo.disabled} - {$DIFFICULTY} + {else} - {$DIFFICULTY} + {/if} @@ -44,7 +44,7 @@ Est. Shares this Round - {(pow(2, 32 - $GLOBAL.config.targetdiff) * $DIFFICULTY)|number_format:"0"} (done: {(100 / (pow(2, 32 - $GLOBAL.config.targetdiff) * $DIFFICULTY) * $GLOBAL.roundshares.valid)|number_format:"2"} %) + Time Since Last Block