summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/javascript/traffic_graph.js
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-07-18 13:12:14 -0300
committerRenato Botelho <renato@netgate.com>2015-07-18 13:12:14 -0300
commitc4f9f44941b2f898220f064a29072166a1d27c0a (patch)
treeca1f31fa6c8d74c890d0e6146e448b869e5bee62 /usr/local/www/widgets/javascript/traffic_graph.js
parent49fc1967c6f754cb39995893cf64b9a1d3c063f1 (diff)
parente24519893a2a740a42430aa57b8d9cf2d89d7f1e (diff)
downloadpfsense-c4f9f44941b2f898220f064a29072166a1d27c0a.zip
pfsense-c4f9f44941b2f898220f064a29072166a1d27c0a.tar.gz
Merge pull request #1756 from phil-davis/traffic-graph-widget-2-2
Diffstat (limited to 'usr/local/www/widgets/javascript/traffic_graph.js')
-rw-r--r--usr/local/www/widgets/javascript/traffic_graph.js41
1 files changed, 24 insertions, 17 deletions
diff --git a/usr/local/www/widgets/javascript/traffic_graph.js b/usr/local/www/widgets/javascript/traffic_graph.js
index dcfd4f3..383a549 100644
--- a/usr/local/www/widgets/javascript/traffic_graph.js
+++ b/usr/local/www/widgets/javascript/traffic_graph.js
@@ -1,34 +1,41 @@
-function trafficshowDiv(incDiv,swapButtons){
- //appear element
+function trafficshowDiv(incDiv,ifDescription,refreshIntervalSec,swapButtons) {
+ // put the graph object HTML in the element and make it appear
selectedDiv = incDiv + "graphdiv";
- jQuery('#' + selectedDiv).effect('blind',{mode:'show'},1000);
- d = document;
- if (swapButtons){
+ jQuery('#' + selectedDiv).html(
+ '<object data="graph.php?ifnum=' + incDiv + '&amp;ifname=' + ifDescription + '&amp;timeint=' + refreshIntervalSec + '&amp;initdelay=0" height="100%" width="100%">' +
+ '<param name="id" value="graph" />' +
+ '<param name="type" value="image/svg+xml" />' +
+ '<param name="pluginspage" value="http://www.adobe.com/svg/viewer/install/auto" />' +
+ '</object>');
+ jQuery('#' + selectedDiv).effect('blind',{mode:'show'},1000);
+ d = document;
+ if (swapButtons) {
selectIntLink = selectedDiv + "-min";
textlink = d.getElementById(selectIntLink);
- textlink.style.display = "inline";
-
+ textlink.style.display = "inline";
+
selectIntLink = selectedDiv + "-open";
textlink = d.getElementById(selectIntLink);
textlink.style.display = "none";
}
- document.iform["shown[" + incDiv + "]"].value = "show";
+ document.traffic_graphs_widget_iform["shown[" + incDiv + "]"].value = "show";
}
-
-function trafficminimizeDiv(incDiv,swapButtons){
- //fade element
+
+function trafficminimizeDiv(incDiv,swapButtons) {
+ // remove the graph object HTML from the element (so it does not keep using CPU) and fade
selectedDiv = incDiv + "graphdiv";
+ jQuery('#' + selectedDiv).html('');
jQuery('#' + selectedDiv).effect('blind',{mode:'hide'},1000);
- d = document;
- if (swapButtons){
+ d = document;
+ if (swapButtons) {
selectIntLink = selectedDiv + "-open";
textlink = d.getElementById(selectIntLink);
- textlink.style.display = "inline";
-
+ textlink.style.display = "inline";
+
selectIntLink = selectedDiv + "-min";
textlink = d.getElementById(selectIntLink);
textlink.style.display = "none";
- }
- document.iform["shown[" + incDiv + "]"].value = "hide";
+ }
+ document.traffic_graphs_widget_iform["shown[" + incDiv + "]"].value = "hide";
}
OpenPOWER on IntegriCloud