summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_rrd_graph_settings.php
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2010-01-12 21:41:37 +0100
committerSeth Mos <seth.mos@xs4all.nl>2010-01-12 21:42:23 +0100
commite08e7ea126d6fd2986935ba140f7028e7ce28050 (patch)
tree28e5a3cde8ccc3ea614930b5916c38eeef9a98d7 /usr/local/www/status_rrd_graph_settings.php
parenta0d1dc5634f97f601b2137514250638a3d9e758c (diff)
downloadpfsense-e08e7ea126d6fd2986935ba140f7028e7ce28050.zip
pfsense-e08e7ea126d6fd2986935ba140f7028e7ce28050.tar.gz
make sure that the settings page also shows only the valid tabs.
Diffstat (limited to 'usr/local/www/status_rrd_graph_settings.php')
-rwxr-xr-xusr/local/www/status_rrd_graph_settings.php38
1 files changed, 30 insertions, 8 deletions
diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php
index 6cab565..d1398c4 100755
--- a/usr/local/www/status_rrd_graph_settings.php
+++ b/usr/local/www/status_rrd_graph_settings.php
@@ -77,6 +77,22 @@ if ($_POST) {
}
}
+$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);
+
+foreach($databases as $database) {
+ if(stristr($database, "wireless")) {
+ $wireless = true;
+ }
+ if(stristr($database, "queues")) {
+ $queues = true;
+ }
+ if(stristr($database, "cellular")) {
+ $cellular = true;
+ }
+}
+
$pgtitle = array("Status","RRD Graphs");
include("head.inc");
@@ -99,14 +115,20 @@ include("head.inc");
$tab_array[] = array("Packets", $tabactive, "status_rrd_graph.php?cat=packets");
if($curcat == "quality") { $tabactive = True; } else { $tabactive = False; }
$tab_array[] = array("Quality", $tabactive, "status_rrd_graph.php?cat=quality");
- if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; }
- $tab_array[] = array("Queues", $tabactive, "status_rrd_graph.php?cat=queues");
- if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; }
- $tab_array[] = array("QueueDrops", $tabactive, "status_rrd_graph.php?cat=queuedrops");
- if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; }
- $tab_array[] = array("Wireless", $tabactive, "status_rrd_graph.php?cat=wireless");
- if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; }
- $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular");
+ if($queues) {
+ if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Queues", $tabactive, "status_rrd_graph.php?cat=queues");
+ if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("QueueDrops", $tabactive, "status_rrd_graph.php?cat=queuedrops");
+ }
+ if($wireless) {
+ if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Wireless", $tabactive, "status_rrd_graph.php?cat=wireless");
+ }
+ if($cellular) {
+ if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular");
+ }
if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; }
$tab_array[] = array("Settings", $tabactive, "status_rrd_graph_settings.php");
display_top_tabs($tab_array);
OpenPOWER on IntegriCloud