diff options
author | Ermal <eri@pfsense.org> | 2013-02-19 18:03:22 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-02-19 18:03:22 +0000 |
commit | b1b930dd1b7d1dc060402dfd10960077bfa4e203 (patch) | |
tree | 72ad544a30b8a024458a7aa3ecc07e750a1278d6 /usr | |
parent | b406c78a1fa408dde44fdbba5eedd103fc20b1fd (diff) | |
download | pfsense-b1b930dd1b7d1dc060402dfd10960077bfa4e203.zip pfsense-b1b930dd1b7d1dc060402dfd10960077bfa4e203.tar.gz |
Use jQuery fully on traffic graph. Also remove some unused code from bandwidth_by_ip
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/bandwidth_by_ip.php | 9 | ||||
-rwxr-xr-x | usr/local/www/status_graph.php | 18 |
2 files changed, 12 insertions, 15 deletions
diff --git a/usr/local/www/bandwidth_by_ip.php b/usr/local/www/bandwidth_by_ip.php index 8e6b11d..002d17d 100755 --- a/usr/local/www/bandwidth_by_ip.php +++ b/usr/local/www/bandwidth_by_ip.php @@ -19,12 +19,15 @@ $listedIPs = ""; //get interface IP and break up into an array $interface = $_GET['if']; -$real_interface = convert_friendly_interface_to_real_interface_name($interface); +$real_interface = get_real_interface($interface); +if (!does_interface_exist($real_interface)) { + echo gettext("Wrong Interface"); + return; +} $intip = find_interface_ip($real_interface); -$intip = explode (".", $intip); //get interface subnet $netmask = find_interface_subnet($real_interface); -$intsubnet = gen_subnet(find_interface_ip($real_interface), $netmask) . "/$netmask"; +$intsubnet = gen_subnet($intip, $netmask) . "/$netmask"; //get the sort method $sort = $_GET['sort']; if ($sort == "out") diff --git a/usr/local/www/status_graph.php b/usr/local/www/status_graph.php index cd08de2..561062e 100755 --- a/usr/local/www/status_graph.php +++ b/usr/local/www/status_graph.php @@ -109,8 +109,8 @@ include("head.inc"); <script language="javascript" type="text/javascript"> function updateBandwidth(){ - var hostinterface = "<?php echo htmlspecialchars($curif); ?>"; - var sorting = "<?php echo htmlspecialchars($cursort); ?>"; + var hostinterface = $("#if").val(); + var sorting = $("#sorting").val(); bandwidthAjax(hostinterface, sorting); } @@ -125,7 +125,7 @@ function bandwidthAjax(hostinterface, sorting) { alert('Error 404: location "' + uri + '" was not found.'); // Handle other errors else - alert('Error ' + req.status + ' -- ' + req.statusText); + alert('Error ' + req.status + ' -- ' + req.statusText + ' -- ' + uri); }, success: function(data) { updateBandwidthHosts(data); @@ -192,7 +192,7 @@ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enabl ?> <form name="form1" action="status_graph.php" method="get" style="padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid #999999"> <?=gettext("Interface"); ?>: -<select name="if" class="formselect" style="z-index: -10;" onchange="document.form1.submit()"> +<select id="if" name="if" class="formselect" style="z-index: -10;" onchange="document.form1.submit()"> <?php foreach ($ifdescrs as $ifn => $ifd) { echo "<option value=\"$ifn\""; @@ -202,13 +202,11 @@ foreach ($ifdescrs as $ifn => $ifd) { ?> </select> , Sort by: -<select name="sort" class="formselect" style="z-index: -10;" onchange="document.form1.submit()"> +<select id="sort" name="sort" class="formselect" style="z-index: -10;" onchange="document.form1.submit()"> <option value="">Bandwidth In</option> <option value="out"<?php if ($cursort == "out") echo " selected";?>>Bandwidth Out</option> </select> </form> -<p><form method="post" action="status_graph.php"> -</form> <p> <div id="niftyOutter"> <div id="col1" style="float: left; width: 46%; padding: 5px; position: relative;"> @@ -310,11 +308,7 @@ foreach ($ifdescrs as $ifn => $ifd) { <?php include("fend.inc"); ?> <script type="text/javascript"> -window.onload = function(in_event) - { - updateBandwidth(); - } - +jQuery(document).ready('updateBandwidth'); </script> </body> </html> |