diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2010-01-12 21:41:37 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2010-01-12 21:42:23 +0100 |
commit | e08e7ea126d6fd2986935ba140f7028e7ce28050 (patch) | |
tree | 28e5a3cde8ccc3ea614930b5916c38eeef9a98d7 | |
parent | a0d1dc5634f97f601b2137514250638a3d9e758c (diff) | |
download | pfsense-e08e7ea126d6fd2986935ba140f7028e7ce28050.zip pfsense-e08e7ea126d6fd2986935ba140f7028e7ce28050.tar.gz |
make sure that the settings page also shows only the valid tabs.
-rwxr-xr-x | usr/local/www/status_rrd_graph_settings.php | 38 |
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); |