summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_rrd_graph.php
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2010-01-03 20:08:58 +0100
committerSeth Mos <seth.mos@xs4all.nl>2010-01-03 20:09:50 +0100
commit7432ce7b8d9d90a0b7ad3910c34e3b50d76c4440 (patch)
treec70dce9f40fd6f81c63d651ee3b7097db98c3368 /usr/local/www/status_rrd_graph.php
parent5a557f44a3071b8eca9cd8bad9250fb624e8fdf9 (diff)
downloadpfsense-7432ce7b8d9d90a0b7ad3910c34e3b50d76c4440.zip
pfsense-7432ce7b8d9d90a0b7ad3910c34e3b50d76c4440.tar.gz
Add more smarts to the RRD page, do not show tabs for database that do not exist, pick the 1st database for
wireless, cellular.
Diffstat (limited to 'usr/local/www/status_rrd_graph.php')
-rwxr-xr-xusr/local/www/status_rrd_graph.php68
1 files changed, 52 insertions, 16 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index 618f69b..f7b5b25 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -75,15 +75,34 @@ if ($_GET['option']) {
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;
+ break;
+ 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;
+ }
+ }
+ case "wireless":
+ foreach($databases as $database) {
+ if(preg_match("/[-]wireless\.rrd/i", $database)) {
+ /* pick off the 1st database we find that matches the wireless graph */
+ $name = explode("-", $database);
+ $curoption = "$name[0]";
+ continue 2;
+ }
+ }
+ case "cellular":
+ foreach($databases as $database) {
+ if(preg_match("/[-]cellular\.rrd/i", $database)) {
+ /* pick off the 1st database we find that matches the celullar graph */
+ $name = explode("-", $database);
+ $curoption = "$name[0]";
+ continue 2;
+ }
}
- }
default:
$curoption = "wan";
break;
@@ -115,6 +134,17 @@ $dbheader = array("allgraphs-traffic.rrd",
"outbound-packets.rrd",
"outbound-traffic.rrd");
+foreach($databases as $database) {
+ if(stristr($database, "wireless")) {
+ $wireless = true;
+ }
+ if(stristr($database, "queues")) {
+ $queues = true;
+ }
+ if(stristr($database, "cellular")) {
+ $cellular = true;
+ }
+}
/* append the existing array to the header */
$ui_databases = array_merge($dbheader, $databases);
@@ -143,14 +173,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