diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-05-22 15:25:25 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-05-22 15:25:25 -0300 |
commit | 0ab02bfd7779210f8047850eafecdc44caa590b6 (patch) | |
tree | 494eb8781315c435aa32482f0d8b47b6bb37d56c /usr/local | |
parent | d05f3d887888b83927d085f8b02bfa8bee1eee5f (diff) | |
parent | 286996b4b1d47aa073c88e1733ff4d9c3efe2020 (diff) | |
download | pfsense-0ab02bfd7779210f8047850eafecdc44caa590b6.zip pfsense-0ab02bfd7779210f8047850eafecdc44caa590b6.tar.gz |
Merge pull request #1168 from ExolonDX/branch_master_16
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/status_graph.php | 35 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/traffic_graphs.widget.php | 24 |
2 files changed, 37 insertions, 22 deletions
diff --git a/usr/local/www/status_graph.php b/usr/local/www/status_graph.php index 9ef7144..ada2fe1 100644 --- a/usr/local/www/status_graph.php +++ b/usr/local/www/status_graph.php @@ -115,9 +115,10 @@ include("head.inc"); ?> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> +<?php include("fbegin.inc"); ?> <script type="text/javascript"> - +//<![CDATA[ function updateBandwidth(){ var hostinterface = jQuery("#if").val(); var sorting = jQuery("#sort").val(); @@ -190,11 +191,9 @@ function updateBandwidthHosts(data){ setTimeout('updateBandwidth()', 1000); } - - +//]]> </script> -<?php include("fbegin.inc"); ?> <?php /* link the ipsec interface magically */ @@ -208,7 +207,7 @@ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enabl <?php foreach ($ifdescrs as $ifn => $ifd) { echo "<option value=\"$ifn\""; - if ($ifn == $curif) echo " selected"; + if ($ifn == $curif) echo " selected=\"selected\""; echo ">" . htmlspecialchars($ifd) . "</option>\n"; } ?> @@ -216,28 +215,34 @@ foreach ($ifdescrs as $ifn => $ifd) { , Sort by: <select id="sort" name="sort" class="formselect" style="z-index: -10;" onchange="document.form1.submit()"> <option value="">Bw In</option> - <option value="out"<?php if ($cursort == "out") echo " selected";?>>Bw Out</option> + <option value="out"<?php if ($cursort == "out") echo " selected=\"selected\"";?>>Bw Out</option> </select> , Filter: <select id="filter" name="filter" class="formselect" style="z-index: -10;" onchange="document.form1.submit()"> - <option value="local"<?php if ($curfilter == "local") echo " selected";?>>Local</option> - <option value="remote"<?php if ($curfilter == "remote") echo " selected";?>>Remote</option> - <option value="all"<?php if ($curfilter == "all") echo " selected";?>>All</option> + <option value="local"<?php if ($curfilter == "local") echo " selected=\"selected\"";?>>Local</option> + <option value="remote"<?php if ($curfilter == "remote") echo " selected=\"selected\"";?>>Remote</option> + <option value="all"<?php if ($curfilter == "all") echo " selected=\"selected\"";?>>All</option> </select> , Display: <select id="hostipformat" name="hostipformat" class="formselect" style="z-index: -10;" onchange="document.form1.submit()"> <option value="">IP Address</option> <option value="hostname"<?php if ($curhostipformat == "hostname") echo " selected";?>>Host Name</option> - <option value="fqdn"<?php if ($curhostipformat == "fqdn") echo " selected";?>>FQDN</option> + <option value="fqdn"<?php if ($curhostipformat == "fqdn") echo " selected=\"selected\"";?>>FQDN</option> </select> </form> -<p> +<p> </p> <div id="niftyOutter"> <div id="col1" style="float: left; width: 46%; padding: 5px; position: relative;"> - <embed src="graph.php?ifnum=<?=htmlspecialchars($curif);?>&ifname=<?=rawurlencode($ifdescrs[htmlspecialchars($curif)]);?>" type="image/svg+xml" width="<?=$width;?>" height="<?=$height;?>" pluginspage="http://www.adobe.com/svg/viewer/install/auto" /> + <object data="graph.php?ifnum=<?=htmlspecialchars($curif);?>&ifname=<?=rawurlencode($ifdescrs[htmlspecialchars($curif)]);?>"> + <param name="id" value="graph" /> + <param name="type" value="image/svg+xml" /> + <param name="width" value="<? echo $width; ?>" /> + <param name="height" value="<? echo $height; ?>" /> + <param name="pluginspage" value="http://www.adobe.com/svg/viewer/install/auto" /> + </object> </div> <div id="col2" style="float: right; width: 48%; padding: 5px; position: relative;"> - <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="status"> <tr> <td class="listtopic" valign="top"><?=(($curhostipformat=="") ? gettext("Host IP") : gettext("Host Name or IP")); ?></td> <td class="listtopic" valign="top"><?=gettext("Bandwidth In"); ?></td> @@ -327,12 +332,14 @@ foreach ($ifdescrs as $ifn => $ifd) { </div> <div style="clear: both;"></div> </div> -<p><span class="red"><strong><?=gettext("Note"); ?>:</strong></span> <?=gettext("the"); ?> <a href="http://www.adobe.com/svg/viewer/install/" target="_blank"><?=gettext("Adobe SVG Viewer"); ?></a>, <?=gettext("Firefox 1.5 or later or other browser supporting SVG is required to view the graph"); ?>. +<p><span class="red"><strong><?=gettext("Note"); ?>:</strong></span> <?=gettext("the"); ?> <a href="http://www.adobe.com/svg/viewer/install/" target="_blank"><?=gettext("Adobe SVG Viewer"); ?></a>, <?=gettext("Firefox 1.5 or later or other browser supporting SVG is required to view the graph"); ?>.</p> <?php include("fend.inc"); ?> <script type="text/javascript"> +//<![CDATA[ jQuery(document).ready(updateBandwidth); +//]]> </script> </body> </html> diff --git a/usr/local/www/widgets/widgets/traffic_graphs.widget.php b/usr/local/www/widgets/widgets/traffic_graphs.widget.php index 28486ac..768a0a2 100644 --- a/usr/local/www/widgets/widgets/traffic_graphs.widget.php +++ b/usr/local/www/widgets/widgets/traffic_graphs.widget.php @@ -96,7 +96,7 @@ if (isset($a_config["scale_type"])) { } ?> -<input type="hidden" id="traffic_graphs-config" name="traffic_graphs-config" value=""> +<input type="hidden" id="traffic_graphs-config" name="traffic_graphs-config" value="" /> <?php //set variables for traffic graph @@ -104,7 +104,7 @@ if (isset($a_config["scale_type"])) { $height = "150"; ?> -<div id="traffic_graphs-settings" name="traffic_graphs-settings" class="widgetconfigdiv" style="display:none;"> +<div id="traffic_graphs-settings" class="widgetconfigdiv" style="display:none;"> <form action="/widgets/widgets/traffic_graphs.widget.php" method="post" name="iform" id="iform"> <?php foreach ($ifdescrs as $ifname => $ifdescr) { ?> <input type="hidden" name="shown[<?= $ifname ?>]" value="<?= $shown[$ifname] ? "show" : "hide" ?>" /> @@ -112,14 +112,14 @@ if (isset($a_config["scale_type"])) { Default AutoScale: <?php $scale_type_up="checked"; - $scale_type_follow="unchecked"; + $scale_type_follow=""; if (isset($config["widgets"]["trafficgraphs"]["scale_type"])) { $selected_radio = $config["widgets"]["trafficgraphs"]["scale_type"]; if ($selected_radio == "up") { - $scale_type_up = "checked"; + $scale_type_up = "checked=\"checked\""; } else if ($selected_radio == "follow") { - $scale_type_follow = "checked"; + $scale_type_follow = "checked=\"checked\""; } } ?> @@ -128,7 +128,7 @@ if (isset($a_config["scale_type"])) { Refresh Interval: <select name="refreshinterval" class="formfld" id="refreshinterval" onchange="updateGraphDisplays();"> <?php for ($i = 1; $i <= 10; $i += 1) { ?> - <option value="<?= $i ?>" <?php if ($refreshinterval == $i) echo "selected='selected'";?>><?= $i ?></option> + <option value="<?= $i ?>" <?php if ($refreshinterval == $i) echo "selected=\"selected\"";?>><?= $i ?></option> <?php } ?> </select> Seconds<br /> <b>Note:</b> changing this setting will increase CPU utilization<br /><br /> <input id="submit" name="submit" type="submit" onclick="return updatePref();" class="formbtn" value="Save Settings" /> @@ -136,10 +136,12 @@ if (isset($a_config["scale_type"])) { </div> <script type="text/javascript"> +//<![CDATA[ d = document; selectIntLink = "traffic_graphs-configure"; textlink = d.getElementById(selectIntLink); textlink.style.display = "inline"; +//]]> </script> <?php @@ -160,7 +162,7 @@ foreach ($ifdescrs as $ifname => $ifdescr) { <div id="<?=$ifname;?>trafficdiv" style="padding: 5px"> <div id="<?=$ifname;?>topic" class="widgetsubheader"> <div style="float:left;width:49%"> - <span onClick="location.href='/status_graph.php?if=<?=$ifname;?>'" style="cursor:pointer">Current <?=$ifdescr;?> Traffic</span> + <span onclick="location.href='/status_graph.php?if=<?=$ifname;?>'" style="cursor:pointer">Current <?=$ifdescr;?> Traffic</span> </div> <div align="right" style="float:right;width:49%"> <div id="<?=$ifname;?>graphdiv-min" onclick='return trafficminimizeDiv("<?= $ifname ?>", true);' @@ -171,7 +173,13 @@ foreach ($ifdescrs as $ifname => $ifdescr) { <div style="clear:both;"></div> </div> <div id="<?=$ifname;?>graphdiv" style="display:<?php echo $graphdisplay;?>"> - <embed id="graph" src="graph.php?ifnum=<?=$ifname;?>&ifname=<?=rawurlencode($ifdescr);?>&timeint=<?=$refreshinterval;?>&initdelay=<?=($graphcounter+1) * 2;?>" type="image/svg+xml" width="100%" height="100%" pluginspage="http://www.adobe.com/svg/viewer/install/auto" /> + <object data="graph.php?ifnum=<?=$ifname;?>&ifname=<?=rawurlencode($ifdescr);?>&timeint=<?=$refreshinterval;?>&initdelay=<?=($graphcounter+1) * 2;?>"> + <param name="id" value="graph" /> + <param name="type" value="image/svg+xml" /> + <param name="width" value="<? echo $width; ?>" /> + <param name="height" value="<? echo $height; ?>" /> + <param name="pluginspage" value="http://www.adobe.com/svg/viewer/install/auto" /> + </object> </div> </div> <?php } |