From 6adb378b429cf14813e8f921235c1498ff30db82 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Wed, 25 Mar 2009 09:21:44 +0000 Subject: [PATCH] path fixes and variable fixes git-svn-id: http://www.observium.org/svn/observer/trunk@380 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/.htaccess | 2 +- html/includes/print-interface.inc | 25 +++++++++++-------------- html/pages/device/bgp.inc.php | 2 +- html/pages/device/ifgraphs.inc.php | 10 +++++----- html/pages/device/ifs.inc.php | 2 +- html/pages/device/interface.inc.php | 2 +- 6 files changed, 20 insertions(+), 23 deletions(-) diff --git a/html/.htaccess b/html/.htaccess index df5745186..fb8cc5b03 100644 --- a/html/.htaccess +++ b/html/.htaccess @@ -20,7 +20,7 @@ RewriteRule ^interfaces/(.+)/ ?page=interfaces&type=$1 RewriteRule ^bill/([0-9]+) ?page=bills&bill=$1 RewriteRule ^device/([0-9]+)/([a-z]+)/([a-z]+)/([a-z|0-9]+)/ ?page=device&id=$1§ion=$2&opta=$3&optb=$4 -RewriteRule ^device/([0-9]+)/([a-z]+)/([a-z|0-9]+)/ ?page=device&id=$1§ion=$2&idb=$3 +RewriteRule ^device/([0-9]+)/([a-z]+)/([a-z|0-9]+)/ ?page=device&id=$1§ion=$2&opta=$3 RewriteRule ^device/([0-9]+)/([a-z]+)/ ?page=device&id=$1§ion=$2 RewriteRule ^device/([0-9]+) ?page=device&id=$1 diff --git a/html/includes/print-interface.inc b/html/includes/print-interface.inc index 5575996e3..084a35534 100644 --- a/html/includes/print-interface.inc +++ b/html/includes/print-interface.inc @@ -5,7 +5,7 @@ $interface['device_id'] = $device['device_id']; $interface['hostname'] = $device['hostname']; - if(!$_GET['type']) { $_GET['type'] = "bits"; } + if(!$graph_type) { $graph_type = "bits"; } $if_id = $interface['interface_id']; @@ -19,15 +19,12 @@ $ifHardType = $interface['ifHardType']; if($ifAlias) {$ifAlias = $ifAlias . "
";} - if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; } + if($bg == "#e5e5e5") { $bg = "#ffffff"; } else { $bg="#e5e5e5"; } if($interface['in_errors'] > 0 || $interface['out_errors'] > 0) { $error_img = generateiflink($interface,"Interface Errors",errors); } else { $error_img = ""; } -# $graph_url = "graph.php?if=$if_id&from=$twoday&to=$now&width=400&height=120&type=bits"; - - echo(" "); @@ -210,19 +207,19 @@ echo(""); // If we're showing graphs, generate the graph and print the img tags if($dographs && is_file($config['rrd_dir'] . "/" . $hostname . "/". $ifIndex . ".rrd")) { - $type = $_GET['type']; + $type = $graph_type; - $daily_traffic = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$day&to=$now&width=210&height=100"; - $daily_url = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$day&to=$now&width=500&height=150"; + $daily_traffic = "graph.php?if=$if_id&type=" . $graph_type . "&from=$day&to=$now&width=210&height=100"; + $daily_url = "graph.php?if=$if_id&type=" . $graph_type . "&from=$day&to=$now&width=500&height=150"; - $weekly_traffic = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$week&to=$now&width=210&height=100"; - $weekly_url = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$week&to=$now&width=500&height=150"; + $weekly_traffic = "graph.php?if=$if_id&type=" . $graph_type . "&from=$week&to=$now&width=210&height=100"; + $weekly_url = "graph.php?if=$if_id&type=" . $graph_type . "&from=$week&to=$now&width=500&height=150"; - $monthly_traffic = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$month&to=$now&width=210&height=100"; - $monthly_url = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$month&to=$now&width=500&height=150"; + $monthly_traffic = "graph.php?if=$if_id&type=" . $graph_type . "&from=$month&to=$now&width=210&height=100"; + $monthly_url = "graph.php?if=$if_id&type=" . $graph_type . "&from=$month&to=$now&width=500&height=150"; - $yearly_traffic = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$year&to=$now&width=210&height=100"; - $yearly_url = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$year&to=$now&width=500&height=150"; + $yearly_traffic = "graph.php?if=$if_id&type=" . $graph_type . "&from=$year&to=$now&width=210&height=100"; + $yearly_url = "graph.php?if=$if_id&type=" . $graph_type . "&from=$year&to=$now&width=500&height=150"; echo(""); diff --git a/html/pages/device/bgp.inc.php b/html/pages/device/bgp.inc.php index eecb8df26..aa4a88b05 100644 --- a/html/pages/device/bgp.inc.php +++ b/html/pages/device/bgp.inc.php @@ -1,6 +1,6 @@ -Bits | -Packets | -NU Packets | -Errors +Bits | +Packets | +NU Packets | +Errors "); $dographs = 1; -if(!$_GET['type']) { $_GET['type'] = "bits"; } +if($_GET['opta']) { $graph_type = $_GET['opta']; } else { $graph_type = "bits"; } include("pages/device/ifs.inc.php"); diff --git a/html/pages/device/ifs.inc.php b/html/pages/device/ifs.inc.php index 2251c8d94..45de68c82 100644 --- a/html/pages/device/ifs.inc.php +++ b/html/pages/device/ifs.inc.php @@ -1,6 +1,6 @@ "); $i = "1"; diff --git a/html/pages/device/interface.inc.php b/html/pages/device/interface.inc.php index 4156d6e2d..2fe90c9bd 100644 --- a/html/pages/device/interface.inc.php +++ b/html/pages/device/interface.inc.php @@ -1,6 +1,6 @@