Admin Option for Ajax Refresh Interval
* Allow admins to change the refresh interval for Ajax calls * Only Gauges affected for now Further Addresses #444 with more goodies
This commit is contained in:
parent
727ed1f79a
commit
b66c3eafec
@ -95,6 +95,13 @@ $aSettings['website'][] = array(
|
|||||||
'name' => 'website_chaininfo_disabled', 'value' => $setting->getValue('website_chaininfo_disabled'),
|
'name' => 'website_chaininfo_disabled', 'value' => $setting->getValue('website_chaininfo_disabled'),
|
||||||
'tooltip' => 'Enabled or disable the chainfo URL feature. Will remove any links using the chaininfo URL.'
|
'tooltip' => 'Enabled or disable the chainfo URL feature. Will remove any links using the chaininfo URL.'
|
||||||
);
|
);
|
||||||
|
$aSettings['statistics'][] = array(
|
||||||
|
'display' => 'Ajax Refresh Interval', 'type' => 'select',
|
||||||
|
'options' => array('5' => '5', '10' => '10', '15' => '15', '30' => '30', '60' => '60' ),
|
||||||
|
'default' => 10,
|
||||||
|
'name' => 'statistics_ajax_refresh_interval', 'value' => $setting->getValue('statistics_ajax_refresh_interval'),
|
||||||
|
'tooltip' => 'How often to refresh data via ajax in seconds.'
|
||||||
|
);
|
||||||
$aSettings['statistics'][] = array(
|
$aSettings['statistics'][] = array(
|
||||||
'display' => 'Block Statistics Count', 'type' => 'text',
|
'display' => 'Block Statistics Count', 'type' => 'text',
|
||||||
'size' => 25,
|
'size' => 25,
|
||||||
|
|||||||
@ -49,6 +49,9 @@ $iCurrentPoolShareRate = $statistics->getCurrentShareRate();
|
|||||||
// Active workers
|
// Active workers
|
||||||
if (!$iCurrentActiveWorkers = $worker->getCountAllActiveWorkers()) $iCurrentActiveWorkers = 0;
|
if (!$iCurrentActiveWorkers = $worker->getCountAllActiveWorkers()) $iCurrentActiveWorkers = 0;
|
||||||
|
|
||||||
|
// Some settings to propagate to template
|
||||||
|
if (! $statistics_ajax_refresh_interval = $setting->getValue('statistics_ajax_refresh_interval')) $statistics_ajax_refresh_interval = 10;
|
||||||
|
|
||||||
// Small helper array
|
// Small helper array
|
||||||
$aHashunits = array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s' );
|
$aHashunits = array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s' );
|
||||||
|
|
||||||
@ -70,6 +73,7 @@ $aGlobal = array(
|
|||||||
'accounts' => $config['accounts'],
|
'accounts' => $config['accounts'],
|
||||||
'disable_invitations' => $setting->getValue('disable_invitations'),
|
'disable_invitations' => $setting->getValue('disable_invitations'),
|
||||||
'disable_notifications' => $setting->getValue('disable_notifications'),
|
'disable_notifications' => $setting->getValue('disable_notifications'),
|
||||||
|
'statistics_ajax_refresh_interval' => $statistics_ajax_refresh_interval,
|
||||||
'price' => array( 'currency' => $config['price']['currency'] ),
|
'price' => array( 'currency' => $config['price']['currency'] ),
|
||||||
'targetdiff' => $config['difficulty'],
|
'targetdiff' => $config['difficulty'],
|
||||||
'currency' => $config['currency'],
|
'currency' => $config['currency'],
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<article class="module width_half">
|
<article class="module width_quarter">
|
||||||
<header><h3>Dashboard</h3></header>
|
<header><h3>Dashboard</h3></header>
|
||||||
<div class="module_content">
|
<div class="module_content">
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
|
|||||||
@ -1,12 +1,15 @@
|
|||||||
<article class="module width_half">
|
<article class="module width_3_quarter">
|
||||||
<header><h3>Gauges</h3></header>
|
<header><h3>Gauges</h3></header>
|
||||||
<div class="module_content">
|
<div class="module_content">
|
||||||
<div id="hashrate" style="width:150px; height:120px; float: left;"></div>
|
<div style="display: inline-block; min-height: 250px;">
|
||||||
<div id="poolhashrate" style="width:150px; height:120px; float: left;"></div>
|
<div id="hashrate" style="width:150px; height:120px; float: left;"></div>
|
||||||
<div id="nethashrate" style="width:150px; height:120px; float: left;"></div>
|
<div id="poolhashrate" style="width:150px; height:120px; float: left;"></div>
|
||||||
<div id="sharerate" style="width:150px; height:120px; float: left;"></div>
|
<div id="nethashrate" style="width:150px; height:120px; float: left;"></div>
|
||||||
<div id="querytime" style="width:150px; height:120px; float: left;"></div>
|
<div id="sharerate" style="width:150px; height:120px; float: left;"></div>
|
||||||
|
<div id="querytime" style="width:150px; height:120px; float: left;"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<footer><p style="margin-left: 25px">Refresh interval: {$GLOBAL.config.statistics_ajax_refresh_interval|default:"10"} seconds</p></footer>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -40,7 +43,7 @@ $(document).ready(function(){
|
|||||||
g5.refresh(parseFloat(data.getdashboarddata.datatime).toFixed(2));
|
g5.refresh(parseFloat(data.getdashboarddata.datatime).toFixed(2));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 10000);
|
}, {/literal}{($GLOBAL.config.statistics_ajax_refresh_interval * 1000)|default:"10000"}{literal});
|
||||||
});
|
});
|
||||||
{/literal}
|
{/literal}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user