mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
vastly simplified .htaccess and cleaned up how we use variables a little
git-svn-id: http://www.observium.org/svn/observer/trunk@2446 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
if (!isset($_GET['optb']) ) { $_GET['optb'] = "graphs"; }
|
||||
if (!isset($_GET['optd']) ) { $_GET['optd'] = "graphs"; }
|
||||
|
||||
$interface = dbFetchRow("SELECT * FROM `ports` WHERE `interface_id` = ?", array($_GET['opta']));
|
||||
$interface = dbFetchRow("SELECT * FROM `ports` WHERE `interface_id` = ?", array($_GET['optc']));
|
||||
|
||||
$port_details = 1;
|
||||
|
||||
@@ -51,90 +51,90 @@ echo("<div style='clear: both;'>");
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
if ($_GET['optb'] == "graphs" || !$_GET['optb']) { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "graphs" || !$_GET['optd']) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/'>Graphs</a>");
|
||||
if ($_GET['optb'] == "graphs" || !$_GET['optb']) { echo("</span>"); }
|
||||
if ($_GET['optd'] == "graphs" || !$_GET['optd']) { echo("</span>"); }
|
||||
|
||||
echo(" | ");
|
||||
|
||||
if ($_GET['optb'] == "realtime" || !$_GET['optb']) { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "realtime" || !$_GET['optd']) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/realtime/'>Real Time</a>");
|
||||
if ($_GET['optb'] == "realtime" || !$_GET['optb']) { echo("</span>"); }
|
||||
if ($_GET['optd'] == "realtime" || !$_GET['optd']) { echo("</span>"); }
|
||||
|
||||
|
||||
if (dbFetchCell("SELECT COUNT(*) FROM `ports_adsl` WHERE `interface_id` = '".$interface['interface_id']."'") )
|
||||
{
|
||||
echo(" | ");
|
||||
if ($_GET['optb'] == "adsl") { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "adsl") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/port/".$interface['interface_id']."/adsl/'>ADSL</a>");
|
||||
if ($_GET['optb'] == "adsl") { echo("</span>"); }
|
||||
if ($_GET['optd'] == "adsl") { echo("</span>"); }
|
||||
}
|
||||
|
||||
echo(" | ");
|
||||
|
||||
if ($_GET['optb'] == "arp") { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "arp") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/arp/'>ARP Table</a>");
|
||||
if ($_GET['optb'] == "arp") { echo("</span>"); }
|
||||
if ($_GET['optd'] == "arp") { echo("</span>"); }
|
||||
|
||||
if (dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE `pagpGroupIfIndex` = '".
|
||||
$interface['ifIndex']."' and `device_id` = '".$device['device_id']."'") )
|
||||
{
|
||||
echo(" | ");
|
||||
if ($_GET['optb'] == "pagp") { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "pagp") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/pagp/'>PAgP</a>");
|
||||
if ($_GET['optb'] == "pagp") { echo("</span>"); }
|
||||
if ($_GET['optd'] == "pagp") { echo("</span>"); }
|
||||
}
|
||||
|
||||
|
||||
if (dbFetchCell("SELECT count(*) FROM mac_accounting WHERE interface_id = '".$interface['interface_id']."'") > "0" )
|
||||
{
|
||||
echo(" | Mac Accounting : ");
|
||||
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && !$_GET['optd']) { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "macaccounting" && $_GET['opte'] == "bits" && !$_GET['optf']) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/macaccounting/bits/'>Bits</a>");
|
||||
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && !$_GET['optd']) { echo("</span>"); }
|
||||
if ($_GET['optd'] == "macaccounting" && $_GET['opte'] == "bits" && !$_GET['optf']) { echo("</span>"); }
|
||||
echo("(");
|
||||
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && $_GET['optd'] == "thumbs") { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "macaccounting" && $_GET['opte'] == "bits" && $_GET['optf'] == "thumbs") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/macaccounting/bits/thumbs/'>Mini</a>");
|
||||
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && $_GET['optd'] == "thumbs") { echo("</span>"); }
|
||||
if ($_GET['optd'] == "macaccounting" && $_GET['opte'] == "bits" && $_GET['optf'] == "thumbs") { echo("</span>"); }
|
||||
echo('|');
|
||||
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && $_GET['optd'] == "top10") { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "macaccounting" && $_GET['opte'] == "bits" && $_GET['optf'] == "top10") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/macaccounting/bits/top10/'>Top10</a>");
|
||||
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && $_GET['optd'] == "top10") { echo("</span>"); }
|
||||
if ($_GET['optd'] == "macaccounting" && $_GET['opte'] == "bits" && $_GET['optf'] == "top10") { echo("</span>"); }
|
||||
echo(") | ");
|
||||
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "pkts" && !$_GET['optd']) { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "macaccounting" && $_GET['opte'] == "pkts" && !$_GET['optf']) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/macaccounting/pkts/'>Packets</a>");
|
||||
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "pkts" && !$_GET['optd']) { echo("</span>"); }
|
||||
if ($_GET['optd'] == "macaccounting" && $_GET['opte'] == "pkts" && !$_GET['optf']) { echo("</span>"); }
|
||||
echo("(");
|
||||
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "pkts" && $_GET['optd'] == "thumbs") { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "macaccounting" && $_GET['opte'] == "pkts" && $_GET['optf'] == "thumbs") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/macaccounting/pkts/thumbs/'>Mini</a>");
|
||||
if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "pkts" && $_GET['optd'] == "thumbs") { echo("</span>"); }
|
||||
if ($_GET['optd'] == "macaccounting" && $_GET['opte'] == "pkts" && $_GET['optf'] == "thumbs") { echo("</span>"); }
|
||||
echo(")");
|
||||
}
|
||||
|
||||
if (dbFetchCell("SELECT COUNT(*) FROM juniAtmVp WHERE interface_id = '".$interface['interface_id']."'") > "0" )
|
||||
{
|
||||
echo(" | ATM VPs : ");
|
||||
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "bits") { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "junose-atm-vp" && $_GET['opte'] == "bits") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/junose-atm-vp/bits/'>Bits</a>");
|
||||
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "bits") { echo("</span>"); }
|
||||
if ($_GET['optd'] == "junose-atm-vp" && $_GET['opte'] == "bits") { echo("</span>"); }
|
||||
echo(" | ");
|
||||
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "packets") { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "junose-atm-vp" && $_GET['opte'] == "packets") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/junose-atm-vp/packets/'>Packets</a>");
|
||||
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "bits") { echo("</span>"); }
|
||||
if ($_GET['optd'] == "junose-atm-vp" && $_GET['opte'] == "bits") { echo("</span>"); }
|
||||
echo(" | ");
|
||||
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "cells") { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "junose-atm-vp" && $_GET['opte'] == "cells") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/junose-atm-vp/cells/'>Cells</a>");
|
||||
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "bits") { echo("</span>"); }
|
||||
if ($_GET['optd'] == "junose-atm-vp" && $_GET['opte'] == "bits") { echo("</span>"); }
|
||||
echo(" | ");
|
||||
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "errors") { echo("<span class='pagemenu-selected'>"); }
|
||||
if ($_GET['optd'] == "junose-atm-vp" && $_GET['opte'] == "errors") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/port/".$interface['interface_id']."/junose-atm-vp/errors/'>Errors</a>");
|
||||
if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "bits") { echo("</span>"); }
|
||||
if ($_GET['optd'] == "junose-atm-vp" && $_GET['opte'] == "bits") { echo("</span>"); }
|
||||
}
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
echo("<div style='margin: 5px;'>");
|
||||
include("pages/device/port/".mres($_GET['optb']).".inc.php");
|
||||
include("pages/device/port/".mres($_GET['optd']).".inc.php");
|
||||
echo("</div>");
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user