summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2010-07-23 11:40:11 +0200
committersmos <seth.mos@dds.nl>2010-07-23 11:40:11 +0200
commit6b0c5ae66c89f75cca03895cb52769db9faa6836 (patch)
tree0f3b1b7c9e03d5dd4a8bda1c4b20e8e889221643 /usr/local
parent9dc3798253279a13ddaae6d6a04269f85c27de5b (diff)
downloadpfsense-6b0c5ae66c89f75cca03895cb52769db9faa6836.zip
pfsense-6b0c5ae66c89f75cca03895cb52769db9faa6836.tar.gz
The custom graph option now works, this needs for a certain someone to
integrate a nice date picker that updates the fields with the correct seconds. Add tab for VPN databases which we don't have yet.
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/status_rrd_graph.php126
1 files changed, 79 insertions, 47 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index a3103f8..036a3b2 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -109,12 +109,22 @@ if ($_GET['option']) {
continue 2;
}
}
+ case "vpn":
+ foreach($databases as $database) {
+ if(preg_match("/[-]vpn\.rrd/i", $database)) {
+ /* pick off the 1st database we find that matches the VPN graphs */
+ $name = explode("-", $database);
+ $curoption = "$name[0]";
+ continue 2;
+ }
+ }
default:
$curoption = "wan";
break;
}
}
+$now = time();
if($curcat == "custom") {
if (is_numeric($_GET['start'])) {
if($start < ($now - (3600 * 24 * 365 * 5))) {
@@ -157,6 +167,7 @@ $dbheader = array("allgraphs-traffic.rrd",
"allgraphs-quality.rrd",
"allgraphs-wireless.rrd",
"allgraphs-cellular.rrd",
+ "allgraphs-vpn.rrd",
"allgraphs-packets.rrd",
"system-allgraphs.rrd",
"system-throughput.rrd",
@@ -174,6 +185,9 @@ foreach($databases as $database) {
if(stristr($database, "cellular")) {
$cellular = true;
}
+ if(stristr($database, "vpn")) {
+ $vpn = true;
+ }
}
/* append the existing array to the header */
$ui_databases = array_merge($dbheader, $databases);
@@ -276,6 +290,10 @@ function get_dates($curperiod, $graph) {
if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; }
$tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular");
}
+ if($vpn) {
+ if($curcat == "vpn") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpn");
+ }
if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; }
$tab_array[] = array("Custom", $tabactive, "status_rrd_graph.php?cat=custom");
if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; }
@@ -369,59 +387,73 @@ function get_dates($curperiod, $graph) {
}
}
?>
-
</select>
-
<?php
if($curcat == "custom") {
-
-
- }
- foreach($graphs as $graph) {
- /* check which databases are valid for our category */
- foreach($ui_databases as $curdatabase) {
- if(! preg_match("/($curcat)/i", $curdatabase)) {
- continue;
- }
- $optionc = split("-", $curdatabase);
- $search = array("-", ".rrd", $optionc);
- $replace = array(" :: ", "", $friendly);
- switch($curoption) {
- case "outbound":
- /* only show interfaces with a gateway */
- $optionc = "$optionc[0]";
- if(!interface_has_gateway($optionc)) {
- if(!preg_match("/($optionc)-(quality)/", $curdatabase)) {
+ ?>
+ <?=gettext("Start:");?>
+ <input type="text" name="start" class="formfldunknown" length="32" value="<?php echo $start;?>">
+ <?=gettext("End:");?>
+ <input type="text" name="end" class="formfldunknown" length="32" value="<?php echo $now;?>">
+ <input type="submit" name="Submit" value="Go">
+ <?
+ $curdatabase = $curoption;
+ $graph = "custom-$curdatabase";
+ if(in_array($curdatabase, $databases)) {
+ echo "<tr><td colspan=2 class=\"list\">\n";
+ echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' ";
+ echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" ";
+ echo "SRC=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}\" />\n";
+ echo "<br /><hr><br />\n";
+ echo "</td></tr>\n";
+ }
+ } else {
+ foreach($graphs as $graph) {
+ /* check which databases are valid for our category */
+ foreach($ui_databases as $curdatabase) {
+ if(! preg_match("/($curcat)/i", $curdatabase)) {
+ continue;
+ }
+ $optionc = split("-", $curdatabase);
+ $search = array("-", ".rrd", $optionc);
+ $replace = array(" :: ", "", $friendly);
+ switch($curoption) {
+ case "outbound":
+ /* only show interfaces with a gateway */
+ $optionc = "$optionc[0]";
+ if(!interface_has_gateway($optionc)) {
+ if(!preg_match("/($optionc)-(quality)/", $curdatabase)) {
+ continue 2;
+ }
+ }
+ if(! preg_match("/($optionc)[-.]/i", $curdatabase)) {
continue 2;
}
- }
- if(! preg_match("/($optionc)[-.]/i", $curdatabase)) {
- continue 2;
- }
- break;
- case "allgraphs":
- /* make sure we do not show the placeholder databases in the all view */
- if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
- continue 2;
- }
- break;
- default:
- /* just use the name here */
- if(! preg_match("/($curoption)[-.]/i", $curdatabase)) {
- continue 2;
- }
- }
- if(in_array($curdatabase, $databases)) {
- $dates = get_dates($curperiod, $graph);
- $start = $dates['start'];
- $end = $dates['end'];
- echo "<tr><td colspan=2 class=\"list\">\n";
- echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' ";
- echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" ";
- echo "SRC=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}\" />\n";
- echo "<br /><hr><br />\n";
- echo "</td></tr>\n";
+ break;
+ case "allgraphs":
+ /* make sure we do not show the placeholder databases in the all view */
+ if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
+ continue 2;
+ }
+ break;
+ default:
+ /* just use the name here */
+ if(! preg_match("/($curoption)[-.]/i", $curdatabase)) {
+ continue 2;
+ }
+ }
+ if(in_array($curdatabase, $databases)) {
+ $dates = get_dates($curperiod, $graph);
+ $start = $dates['start'];
+ $end = $dates['end'];
+ echo "<tr><td colspan=2 class=\"list\">\n";
+ echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' ";
+ echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" ";
+ echo "SRC=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}\" />\n";
+ echo "<br /><hr><br />\n";
+ echo "</td></tr>\n";
+ }
}
}
}
OpenPOWER on IntegriCloud