diff --git a/public/include/config/admin_settings.inc.php b/public/include/config/admin_settings.inc.php index ec2f8087..178e90a6 100644 --- a/public/include/config/admin_settings.inc.php +++ b/public/include/config/admin_settings.inc.php @@ -95,6 +95,13 @@ $aSettings['website'][] = array( '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.' ); +$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( 'display' => 'Block Statistics Count', 'type' => 'text', 'size' => 25, diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index acce6725..f66e7e34 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -49,6 +49,9 @@ $iCurrentPoolShareRate = $statistics->getCurrentShareRate(); // Active workers 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 $aHashunits = array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s' ); @@ -70,6 +73,7 @@ $aGlobal = array( 'accounts' => $config['accounts'], 'disable_invitations' => $setting->getValue('disable_invitations'), 'disable_notifications' => $setting->getValue('disable_notifications'), + 'statistics_ajax_refresh_interval' => $statistics_ajax_refresh_interval, 'price' => array( 'currency' => $config['price']['currency'] ), 'targetdiff' => $config['difficulty'], 'currency' => $config['currency'], diff --git a/public/templates/test/dashboard/default_prop.tpl b/public/templates/test/dashboard/default_prop.tpl index aff7a0a8..08f0ce24 100644 --- a/public/templates/test/dashboard/default_prop.tpl +++ b/public/templates/test/dashboard/default_prop.tpl @@ -1,4 +1,4 @@ -
+

Dashboard

diff --git a/public/templates/test/dashboard/gauges.tpl b/public/templates/test/dashboard/gauges.tpl index 82f34622..6bdc6723 100644 --- a/public/templates/test/dashboard/gauges.tpl +++ b/public/templates/test/dashboard/gauges.tpl @@ -1,12 +1,15 @@ -
+

Gauges

-
-
-
-
-
+
+
+
+
+
+
+
+

Refresh interval: {$GLOBAL.config.statistics_ajax_refresh_interval|default:"10"} seconds