From 728ee2dd115f064257c13a68488373bde88ae811 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sat, 14 Sep 2013 23:01:31 +0200 Subject: [PATCH] Feature update and Improvement to Dashboard * [FEATURE] Dasboard honors Ajax interval for hashrate graph * [IMPROVEMENT] Load graph plugins on graph template not on master template --- .../include/pages/api/getuserhashrate.inc.php | 5 ++- public/templates/test/dashboard/graph.tpl | 37 +++++++++++++++---- public/templates/test/master.tpl | 5 +-- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/public/include/pages/api/getuserhashrate.inc.php b/public/include/pages/api/getuserhashrate.inc.php index 99ac2de9..c9cf6b09 100644 --- a/public/include/pages/api/getuserhashrate.inc.php +++ b/public/include/pages/api/getuserhashrate.inc.php @@ -31,10 +31,13 @@ if ( ! $user->isAdmin($user_id) && ($_REQUEST['id'] != $user_id && !empty($_REQU $username = $user->getUserName($id); } +// Fetch some settings +if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300; + // Gather un-cached data $statistics->setGetCache(false); $start = microtime(true); -$hashrate = $statistics->getUserHashrate($id, 300); +$hashrate = $statistics->getUserHashrate($id, $interval); $end = microtime(true); $runtime = ($end - $start)* 1000; diff --git a/public/templates/test/dashboard/graph.tpl b/public/templates/test/dashboard/graph.tpl index b5a654b7..44e9ea30 100644 --- a/public/templates/test/dashboard/graph.tpl +++ b/public/templates/test/dashboard/graph.tpl @@ -1,8 +1,17 @@ + + + + + +

Graphs

-
+
+
+

Refresh interval: {$GLOBAL.config.statistics_ajax_refresh_interval|default:"10"} seconds. Hashrate based on shares submitted in the past {$INTERVAL|default:"5"} minutes.

+
diff --git a/public/templates/test/master.tpl b/public/templates/test/master.tpl index c8c7c685..f825201e 100644 --- a/public/templates/test/master.tpl +++ b/public/templates/test/master.tpl @@ -10,9 +10,9 @@ + @@ -20,9 +20,6 @@ - - -