summaryrefslogtreecommitdiffstats
path: root/usr/local/www/graph.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-10-11 17:10:35 -0400
committerjim-p <jimp@pfsense.org>2010-10-11 17:10:35 -0400
commit9228de6c4d231ab1325014e8341f5d0f981a0af0 (patch)
tree58055cb0e6fa81e13f2bc837d67d711cb2826787 /usr/local/www/graph.php
parent719dcffb6e6bef6e911fe570067699917cccbc84 (diff)
downloadpfsense-9228de6c4d231ab1325014e8341f5d0f981a0af0.zip
pfsense-9228de6c4d231ab1325014e8341f5d0f981a0af0.tar.gz
Fix graph staggering, the old method was causing the graphs to diverge in update intervals over time.
Diffstat (limited to 'usr/local/www/graph.php')
-rwxr-xr-xusr/local/www/graph.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr/local/www/graph.php b/usr/local/www/graph.php
index 964c2c7..14af862 100755
--- a/usr/local/www/graph.php
+++ b/usr/local/www/graph.php
@@ -61,6 +61,11 @@ if ($_GET["timeint"])
else
$time_interval = 3;
+if ($_GET["initdelay"])
+ $init_delay = $_GET["initdelay"]; //Initial Delay
+else
+ $init_delay = 3;
+
//SVG attributes
$attribs['axis']='fill="black" stroke="black"';
$attribs['in']='fill="#FF0000" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="7"';
@@ -229,13 +234,13 @@ function plot_data(obj) {
last_ugmt = ugmt;
last_ifin = ifin;
last_ifout = ifout;
-
+ var graphTimerId = 0;
switch (plot_in.length) {
case 0:
SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'visible');
plot_in[0] = diff_ifin / diff_ugmt;
plot_out[0] = diff_ifout / diff_ugmt;
- setTimeout('fetch_data()',<?=1000*$time_interval?>);
+ setTimeout('fetch_data()',<?=1000*($time_interval + $init_delay)?>);
return;
case 1:
SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'hidden');
OpenPOWER on IntegriCloud