diff options
author | Scott Dale <sdale@pfsense.org> | 2007-05-24 02:43:05 +0000 |
---|---|---|
committer | Scott Dale <sdale@pfsense.org> | 2007-05-24 02:43:05 +0000 |
commit | 15173791bf7c121a9993b84722afa1a3e84b2edc (patch) | |
tree | 20c1d8ff2b21ef60194d308960b936193886cd34 /usr/local | |
parent | 775d112b5f7acf0353b871e9b33683d3cb2aec4e (diff) | |
download | pfsense-15173791bf7c121a9993b84722afa1a3e84b2edc.zip pfsense-15173791bf7c121a9993b84722afa1a3e84b2edc.tar.gz |
allow user to configure refresh interval. Default is 3 seconds
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/widgets/javascript/traffic_graph.js | 4 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/traffic_graphs.widget.php | 34 |
2 files changed, 37 insertions, 1 deletions
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"; + } +?> + +<div id="traffic_graphs-settings" name="traffic_graphs-settings" class="widgetconfigdiv" style="display:none;"> +Refresh Interval: + <select name="refreshInterval" class="formfld" id="refreshInterval" onchange="updateGraphDisplays();"> + <option value="1" <?php if ($refreshInterval == "1") echo "SELECTED";?>>1</option> + <option value="2" <?php if ($refreshInterval == "2") echo "SELECTED";?>>2</option> + <option value="3" <?php if ($refreshInterval == "3") echo "SELECTED";?>>3</option> + <option value="4" <?php if ($refreshInterval == "4") echo "SELECTED";?>>4</option> + <option value="5" <?php if ($refreshInterval == "5") echo "SELECTED";?>>5</option> + </select> Seconds<br> <b>Note:</b> changing this settings can affect CPU Performance on the pfSense Box<br><br> + <input id="submit" name="submit" type="submit" onclick="return updatePref();" class="formbtn" value="Save Settings" /> +</div> + +<script language="javascript" type="text/javascript"> + d = document; + selectIntLink = "traffic_graphs-configure"; + textlink = d.getElementById(selectIntLink); + textlink.style.display = "inline"; + </script> + +<?php + if (get_cpu_speed() >= 500) $firstgraphshown = false; else @@ -68,7 +100,7 @@ <div style="clear:both;"></div> </div> <div id="<?=$ifname;?>graphdiv" style="display:<?php echo $graphdisplay;?>"> - <embed id="graph" src="graph.php?ifnum=<?=$ifnum;?>&ifname=<?=rawurlencode($ifname);?>" type="image/svg+xml" width="<? echo $width; ?>" height="<? echo $height; ?>" pluginspage="http://www.adobe.com/svg/viewer/install/auto" /> + <embed id="graph" src="graph.php?ifnum=<?=$ifnum;?>&ifname=<?=rawurlencode($ifname);?>&timeint=<?=$refreshInterval;?>" type="image/svg+xml" width="<? echo $width; ?>" height="<? echo $height; ?>" pluginspage="http://www.adobe.com/svg/viewer/install/auto" /> </div> <? $firstgraphshown = true; $graphcounter++;} ?> </div> |