summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_rrd_graph.php
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2009-04-07 15:08:56 +0200
committerSeth Mos <seth.mos@xs4all.nl>2009-04-07 15:09:59 +0200
commit329bb7646479d22b7ffa7c400f24c723b8425394 (patch)
tree3e3e3abc845b969231ea8b48049d2dc045c67a16 /usr/local/www/status_rrd_graph.php
parentb040124aa6d4c40478bb3f2b99a8689d82fbdbf9 (diff)
downloadpfsense-329bb7646479d22b7ffa7c400f24c723b8425394.zip
pfsense-329bb7646479d22b7ffa7c400f24c723b8425394.tar.gz
Add some smarts so that it always shows the 1st found quality database with Static gateways
Replace ifthenelse with a switch
Diffstat (limited to 'usr/local/www/status_rrd_graph.php')
-rwxr-xr-xusr/local/www/status_rrd_graph.php38
1 files changed, 26 insertions, 12 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index a4a07c6..0f3b420 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -42,6 +42,10 @@ if(! isset($config['rrd']['enable'])) {
header("Location: status_rrd_graph_settings.php");
}
+$rrddbpath = "/var/db/rrd/";
+/* XXX: (billm) do we have an exec() type function that does this type of thing? */
+exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases);
+
if ($_GET['cat']) {
$curcat = $_GET['cat'];
} else {
@@ -55,14 +59,27 @@ if ($_GET['cat']) {
if ($_GET['option']) {
$curoption = $_GET['option'];
} else {
- if($curcat == "system") {
- $curoption = "processor";
- } else if($curcat == "queues") {
- $curoption = "queues";
- } else if($curcat == "queuedrops") {
- $curoption = "queuedrops";
- } else {
- $curoption = "wan";
+ switch($curcat) {
+ case "system":
+ $curoption = "processor";
+ break;
+ case "queues":
+ $curoption = "queues";
+ break;
+ case "queuedrops":
+ $curoption = "queuedrops";
+ case "quality":
+ foreach($databases as $database) {
+ if(preg_match("/[-]quality\.rrd/i", $database)) {
+ /* pick off the 1st database we find that matches the quality graph */
+ $name = explode("-", $database);
+ $curoption = "$name[0]";
+ continue 2;
+ }
+ }
+ default:
+ $curoption = "wan";
+ break;
}
}
@@ -76,10 +93,7 @@ if ($_GET['style']) {
}
}
-$rrddbpath = "/var/db/rrd/";
-
-/* XXX: (billm) do we have an exec() type function that does this type of thing? */
-exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases);
+/* sort names reverse so WAN comes first */
rsort($databases);
/* these boilerplate databases are required for the other menu choices */
OpenPOWER on IntegriCloud