From 15173791bf7c121a9993b84722afa1a3e84b2edc Mon Sep 17 00:00:00 2001 From: Scott Dale Date: Thu, 24 May 2007 02:43:05 +0000 Subject: allow user to configure refresh interval. Default is 3 seconds --- usr/local/www/widgets/javascript/traffic_graph.js | 4 +++ .../www/widgets/widgets/traffic_graphs.widget.php | 34 +++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/widgets/javascript/traffic_graph.js b/usr/local/www/widgets/javascript/traffic_graph.js index 8ee192a..a15827c 100644 --- a/usr/local/www/widgets/javascript/traffic_graph.js +++ b/usr/local/www/widgets/javascript/traffic_graph.js @@ -54,6 +54,10 @@ function updateGraphDisplays(){ graphsdisplayed += textlink; firstprint = true; } + selectIntLink = "refreshInterval"; + graphsdisplayed += ",refreshInterval="; + graphsdisplayed += d.getElementById(selectIntLink).value; + selectIntLink = "traffic_graphs-config"; textlink = d.getElementById(selectIntLink); textlink.value = graphsdisplayed; diff --git a/usr/local/www/widgets/widgets/traffic_graphs.widget.php b/usr/local/www/widgets/widgets/traffic_graphs.widget.php index 0a6c1a6..9f7b8ef 100644 --- a/usr/local/www/widgets/widgets/traffic_graphs.widget.php +++ b/usr/local/www/widgets/widgets/traffic_graphs.widget.php @@ -9,7 +9,39 @@ $height = "150"; $showngraphlist = explode(",", $pconfig['traffic_graphs-config']); $graphcounter = 0; + if($config['widgets']['traffic_graphs-config']){ + $graphlistcount = count($showngraphlist); + $refreshintervalstring = $showngraphlist[$graphlistcount-1]; + $eqposition = strpos($refreshintervalstring,"="); + $refreshInterval = substr($refreshintervalstring, $eqposition+1); + } + else { + $refreshInterval = "3"; + } +?> + + + + + += 500) $firstgraphshown = false; else @@ -68,7 +100,7 @@
- +
-- cgit v1.1