[UPDATE] dashboard fixes, disable tickerupdate in cron/dashboard

This commit is contained in:
iAmShorty 2014-03-05 16:21:23 +01:00
parent faf414e669
commit b85a47ac50
7 changed files with 28 additions and 13 deletions

View File

@ -33,18 +33,26 @@ $log->logInfo('Running periodic tasks to update database values for GUI access')
$strLogMask = "| %-25.25s | %15.15s | %8.8s | %-6.6s | %-80.80s |";
$log->logInfo(sprintf($strLogMask, 'Method', 'Value', 'Runtime', 'Status', 'Message'));
empty($config['price']['enabled']) ? $tickerupdate = false : $tickerupdate = $config['price']['enabled'];
// Fetch latest coin price via API call
$start = microtime(true);
$message = 'Updated latest ' . $config['currency'] . ' price from ' . $config['price']['url'] . ' API';
$status = 'OK';
if ($price = $tools->getPrice()) {
if (!$setting->setValue('price', $price)) {
$message = 'Unable to store new price value: ' . $setting->getCronError();
if ($tickerupdate) {
$message = 'Updated latest ' . $config['currency'] . ' price from ' . $config['price']['url'] . ' API';
$status = 'OK';
if ($price = $tools->getPrice()) {
if (!$setting->setValue('price', $price)) {
$message = 'Unable to store new price value: ' . $setting->getCronError();
$status = 'ERROR';
}
} else {
$message = 'Failed to fetch price from API: ' . $tools->getCronError();
$status = 'ERROR';
}
} else {
$message = 'Failed to fetch price from API: ' . $tools->getCronError();
$status = 'ERROR';
$message = 'Tickerupdate is disabled';
$status = 'OK';
$price = 0;
}
$log->logInfo(sprintf($strLogMask, 'Price Update', $price, number_format(microtime(true) - $start, 3), $status, $message));

View File

@ -83,6 +83,7 @@ $aGlobal = array(
'statistics_ajax_refresh_interval' => $statistics_ajax_refresh_interval,
'statistics_ajax_long_refresh_interval' => $statistics_ajax_long_refresh_interval,
'price' => array( 'currency' => $config['price']['currency'] ),
'tickerupdate' => array( 'enabled' => $config['price']['enabled'] ),
'targetdiff' => $config['difficulty'],
'currency' => $config['currency'],
'txfee_manual' => $config['txfee_manual'],

View File

@ -323,5 +323,3 @@ table.dataTable thead .sorting:after {
.borderless > tbody > tr > td {
border: none;
}

0
public/templates/bootstrap/dashboard/account_data.tpl Normal file → Executable file
View File

View File

@ -37,7 +37,9 @@ $(document).ready(function(){
$('.personal-sharerate-bar').sparkline(storedPersonalSharerate, sparklineBarOptions);
$('.pool-hashrate-bar').sparkline(storedPoolHashrate, sparklineBarOptions);
$('.pool-workers-bar').sparkline(storedPoolWorkers, sparklineBarOptions);
{/literal}{if $config.tickerupdate.enabled}{literal}
$('.coin-price-line').sparkline(storedCoinPrice, sparklineLineOptions);
{/literal}{/if}{literal}
function refreshInformation(data) {
// Drop one value, add the latest new one to each array
@ -56,12 +58,16 @@ $(document).ready(function(){
$('.personal-sharerate-bar').sparkline(storedPersonalSharerate, sparklineBarOptions);
$('.pool-hashrate-bar').sparkline(storedPoolHashrate, sparklineBarOptions);
$('.pool-workers-bar').sparkline(storedPoolWorkers, sparklineBarOptions);
{/literal}{if $config.tickerupdate.enabled}{literal}
$('.coin-price-line').sparkline(storedCoinPrice, sparklineLineOptions);
{/literal}{/if}{literal}
}
// Refresh other static numbers on the template
function refreshStaticData(data) {
{/literal}{if $config.tickerupdate.enabled}{literal}
$('#b-price').html((parseFloat(data.getdashboarddata.data.pool.price).toFixed(8)));
{/literal}{/if}{literal}
$('#b-poolworkers').html(data.getdashboarddata.data.pool.workers);
$('#b-hashrate').html((parseFloat(data.getdashboarddata.data.personal.hashrate).toFixed(2)));
$('#b-poolhashrate').html((parseFloat(data.getdashboarddata.data.pool.hashrate).toFixed(2)));

View File

@ -3,8 +3,8 @@
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-align-left fa-fw"></i> Overview</span></h4>
</div>
<div class="panel-body">
<div class="row show-grid" style="text-align:center;">
<div class="panel-body text-center">
<div class="row show-grid">
<div class="col-md-spark">
<p style="font-weight: bold; margin: 0px 0px -3px;">My Hashrate {$GLOBAL.hashunits.personal}</p>
<span style="font-size: 24px; font-weight: bold;" id="b-hashrate">{$GLOBAL.userdata.hashrate|number_format:"2"}</span>
@ -29,13 +29,15 @@
<br>
<span class="pool-workers-bar"></span>
</div>
{if $GLOBAL.config.tickerupdate.enabled}
<div class="col-md-spark">
<p style="font-weight: bold; margin: 0px 0px -3px;">{$GLOBAL.config.currency}/{$GLOBAL.config.price.currency}</p>
<span style="font-size: 24px; font-weight: bold;" id="b-price">{$GLOBAL.price|default:"0"|number_format:"8"}</span>
<br>
<span class="coin-price-line"></span>
</div>
</div>
{/if}
</div>
</div>
<div class="panel-footer" style="margin: 20px 0px 0px;">
Refresh interval: {$GLOBAL.config.statistics_ajax_refresh_interval|default:"10"} seconds. Hashrate based on shares submitted in the past {$INTERVAL|default:"5"} minutes.

2
public/templates/bootstrap/dashboard/round_stats.tpl Normal file → Executable file
View File

@ -1,4 +1,4 @@
<div class="col-lg-12">
<div class="col-lg-8">
<div class="panel panel-info">
<div class="panel-heading">
<h4 class="panel-title">