summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_graph.php
diff options
context:
space:
mode:
authorVinicius Coque <vcoque@gmail.com>2011-10-22 20:13:06 -0200
committerVinicius Coque <vcoque@gmail.com>2011-10-22 20:13:06 -0200
commite03ef9a02cb3b3e328be1eab5230114483082853 (patch)
treee5c7dc1f4011fc6e6bbc9ceb8f79b64f319d7a04 /usr/local/www/status_graph.php
parent78d84a88e0f87ad2b44aa8f3c6b5d37fee2135e7 (diff)
downloadpfsense-e03ef9a02cb3b3e328be1eab5230114483082853.zip
pfsense-e03ef9a02cb3b3e328be1eab5230114483082853.tar.gz
Converting ajax code from prototype to jQuery
Diffstat (limited to 'usr/local/www/status_graph.php')
-rwxr-xr-xusr/local/www/status_graph.php37
1 files changed, 17 insertions, 20 deletions
diff --git a/usr/local/www/status_graph.php b/usr/local/www/status_graph.php
index bc689ab..628c9bc 100755
--- a/usr/local/www/status_graph.php
+++ b/usr/local/www/status_graph.php
@@ -103,21 +103,20 @@ function bandwidthAjax(hostinterface) {
uri = "bandwidth_by_ip.php?if=" + hostinterface;
var opt = {
// Use GET
- method: 'get',
- asynchronous: true,
- // Handle 404
- on404: function(t) {
- alert('Error 404: location "' + t.statusText + '" was not found.');
+ type: 'get',
+ error: function(req) {
+ // Handle 404
+ if(req.status == 404)
+ alert('Error 404: location "' + uri + '" was not found.');
+ // Handle other errors
+ else
+ alert('Error ' + req.status + ' -- ' + req.statusText);
},
- // Handle other errors
- onFailure: function(t) {
- alert('Error ' + t.status + ' -- ' + t.statusText);
- },
- onSuccess: function(t) {
- updateBandwidthHosts(t.responseText);
+ success: function(data) {
+ updateBandwidthHosts(data);
}
}
- new Ajax.Request(uri, opt);
+ jQuery.ajax(uri, opt);
}
function updateBandwidthHosts(data){
@@ -145,21 +144,19 @@ function updateBandwidthHosts(data){
hostbandwidthOut.innerHTML = hostinfo[2] + " Bits/sec";
//make the row appear if hidden
- var rowid = "host" + y;
- textlink = d.getElementById(rowid);
- if (textlink.style.display == "none"){
+ var rowid = "#host" + y;
+ if (jQuery(rowid).css('dislay') == "none"){
//hide rows that contain no data
- Effect.Appear(rowid, {duration:1});
+ jQuery(rowid).show(1000);
}
}
}
else
{
- var rowid = "host" + y;
- textlink = d.getElementById(rowid);
- if (textlink.style.display != "none"){
+ var rowid = "#host" + y;
+ if (jQuery(rowid).css('dislay') != "none"){
//hide rows that contain no data
- Effect.Fade(rowid, {duration:2});
+ jQuery(rowid).fadeOut(2000);
}
}
}
OpenPOWER on IntegriCloud