mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
migrate routing/vrf&bgp to new urls
git-svn-id: http://www.observium.org/svn/observer/trunk@2501 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -40,11 +40,6 @@ $type_text['frequency'] = "Frequency";
|
||||
$type_text['current'] = "Current";
|
||||
$type_text['power'] = "Power";
|
||||
|
||||
$link_array = array('page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
'tab' => 'health');
|
||||
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
echo("<span style='font-weight: bold;'>Health</span> » ");
|
||||
|
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
$link_array = array('page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
'tab' => 'routing');
|
||||
|
||||
#$type_text['overview'] = "Overview";
|
||||
$type_text['ipsec_tunnels'] = "IPSEC Tunnels";
|
||||
$type_text['bgp'] = "BGP";
|
||||
@@ -15,25 +19,25 @@ unset($sep);
|
||||
foreach ($routing_tabs as $type)
|
||||
{
|
||||
|
||||
if (!$_GET['optc']) { $_GET['optc'] = $type; }
|
||||
if (!$vars['proto']) { $vars['proto'] = $type; }
|
||||
|
||||
echo($sep);
|
||||
|
||||
if ($_GET['optc'] == $type)
|
||||
if ($vars['proto'] == $type)
|
||||
{
|
||||
echo('<span class="pagemenu-selected">');
|
||||
}
|
||||
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/routing/" . $type . "/'> " . $type_text[$type] ." (".$device_routing_count[$type].")</a>");
|
||||
if ($_GET['optc'] == $type) { echo("</span>"); }
|
||||
echo(generate_link($type_text[$type] ." (".$device_routing_count[$type].")",$link_array,array('proto'=>$type)));
|
||||
if ($vars['proto'] == $type) { echo("</span>"); }
|
||||
$sep = " | ";
|
||||
}
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if (is_file("pages/device/routing/".mres($_GET['optc']).".inc.php"))
|
||||
if (is_file("pages/device/routing/".mres($vars['proto']).".inc.php"))
|
||||
{
|
||||
include("pages/device/routing/".mres($_GET['optc']).".inc.php");
|
||||
include("pages/device/routing/".mres($vars['proto']).".inc.php");
|
||||
} else {
|
||||
foreach ($routing_tabs as $type)
|
||||
{
|
||||
|
@@ -3,47 +3,55 @@
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$link_array = array('page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
'tab' => 'routing',
|
||||
'proto' => 'bgp');
|
||||
|
||||
if(!isset($vars['view'])) { $vars['view'] = "basic"; }
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
echo("<span style='font-weight: bold;'>BGP</span> » ");
|
||||
|
||||
if (!isset($_GET['optb'])) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='device/" . $device['device_id'] . "/routing/bgp/'>Basic</a>");
|
||||
if (!isset($_GET['optb'])) { echo("</span>"); }
|
||||
if ($vars['view'] == "basic") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo(generate_link("Basic", $link_array,array('view'=>'basic')));
|
||||
if ($vars['view'] == "basic") { echo("</span>"); }
|
||||
|
||||
echo(" | ");
|
||||
|
||||
if ($_GET['optb'] == "updates") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='device/" . $device['device_id'] . "/routing/bgp/updates/'>Updates</a>");
|
||||
if ($_GET['optb'] == "updates") { echo("</span>"); }
|
||||
if ($vars['view'] == "updates") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo(generate_link("Updates", $link_array,array('view'=>'updates')));
|
||||
if ($vars['view'] == "updates") { echo("</span>"); }
|
||||
|
||||
echo(" | Prefixes: ");
|
||||
|
||||
if ($_GET['optb'] == "prefixes_ipv4unicast") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='device/" . $device['device_id'] . "/routing/bgp/prefixes_ipv4unicast/'>IPv4</a>");
|
||||
if ($_GET['optb'] == "prefixes_ipv4unicast") { echo("</span>"); }
|
||||
if ($vars['view'] == "prefixes_ipv4unicast") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo(generate_link("IPv4", $link_array,array('view'=>'prefixes_ipv4unicast')));
|
||||
if ($vars['view'] == "prefixes_ipv4unicast") { echo("</span>"); }
|
||||
|
||||
echo(" | ");
|
||||
|
||||
if ($_GET['optb'] == "prefixes_vpnv4unicast") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='device/" . $device['device_id'] . "/routing/bgp/prefixes_vpnv4unicast/'>VPNv4</a>");
|
||||
if ($_GET['optb'] == "prefixes_vpnv4unicast") { echo("</span>"); }
|
||||
if ($vars['view'] == "prefixes_vpnv4unicast") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo(generate_link("VPNv4", $link_array,array('view'=>'prefixes_vpnv4unicast')));
|
||||
if ($vars['view'] == "prefixes_vpnv4unicast") { echo("</span>"); }
|
||||
|
||||
echo(" | ");
|
||||
|
||||
if ($_GET['optb'] == "prefixes_ipv6unicast") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='device/" . $device['device_id'] . "/routing/bgp/prefixes_ipv6unicast/'>IPv6</a>");
|
||||
if ($_GET['optb'] == "prefixes_ipv6unicast") { echo("</span>"); }
|
||||
if ($vars['view'] == "prefixes_ipv6unicast") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo(generate_link("IPv6", $link_array,array('view'=>'prefixes_ipv6unicast')));
|
||||
if ($vars['view'] == "prefixes_ipv6unicast") { echo("</span>"); }
|
||||
|
||||
echo(" | Traffic: ");
|
||||
|
||||
if ($_GET['optb'] == "macaccounting_bits") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='device/" . $device['device_id'] . "/routing/bgp/macaccounting_bits/'>Bits</a>");
|
||||
if ($_GET['optb'] == "macaccounting_bits") { echo("</span>"); }
|
||||
if ($vars['view'] == "macaccounting_bits") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo(generate_link("Bits", $link_array,array('view'=>'macaccounting_bits')));
|
||||
if ($vars['view'] == "macaccounting_bits") { echo("</span>"); }
|
||||
echo(" | ");
|
||||
if ($_GET['optb'] == "macaccounting_pkts") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='device/" . $device['device_id'] . "/routing/bgp/macaccounting_pkts/'>Packets</a>");
|
||||
if ($_GET['optb'] == "macaccounting_pkts") { echo("</span>"); }
|
||||
if ($vars['view'] == "macaccounting_pkts") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo(generate_link("Packets", $link_array,array('view'=>'macaccounting_pkts')));
|
||||
if ($vars['view'] == "macaccounting_pkts") { echo("</span>"); }
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
@@ -138,22 +146,22 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? ORDER BY `b
|
||||
|
||||
unset($invalid);
|
||||
|
||||
switch ($_GET['optb'])
|
||||
switch ($vars['view'])
|
||||
{
|
||||
case 'prefixes_ipv4unicast':
|
||||
case 'prefixes_ipv4multicast':
|
||||
case 'prefixes_ipv4vpn':
|
||||
case 'prefixes_ipv6unicast':
|
||||
case 'prefixes_ipv6multicast':
|
||||
list(,$afisafi) = explode("_", $_GET['optb']);
|
||||
list(,$afisafi) = explode("_", $vars['view']);
|
||||
if (isset($peer['afisafi'][$afisafi])) { $peer['graph'] = 1; }
|
||||
# FIXME no break??
|
||||
case 'updates':
|
||||
$graph_array['type'] = "bgp_" . $_GET['optb'];
|
||||
$graph_array['type'] = "bgp_" . $vars['view'];
|
||||
$graph_array['id'] = $peer['bgpPeer_id'];
|
||||
}
|
||||
|
||||
switch ($_GET['optb'])
|
||||
switch ($vars['view'])
|
||||
{
|
||||
case 'macaccounting_bits':
|
||||
case 'macaccounting_pkts':
|
||||
@@ -163,11 +171,11 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? ORDER BY `b
|
||||
{
|
||||
$peer['graph'] = 1;
|
||||
$graph_array['id'] = $acc['ma_id'];
|
||||
$graph_array['type'] = $_GET['optb'];
|
||||
$graph_array['type'] = $vars['view'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET['optb'] == 'updates') { $peer['graph'] = 1; }
|
||||
if ($vars['view'] == 'updates') { $peer['graph'] = 1; }
|
||||
|
||||
if($peer['graph'])
|
||||
{
|
||||
|
@@ -1,8 +1,20 @@
|
||||
<?php
|
||||
|
||||
$link_array = array('page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
'tab' => 'routing',
|
||||
'proto' => 'vrf');
|
||||
|
||||
#echo(generate_link("Basic", $link_array,array('view'=>'basic')));
|
||||
|
||||
if(!isset($vars['view'])) { $vars['view'] = "basic"; }
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
echo("<span style='font-weight: bold;'>VRFs</span> » ");
|
||||
|
||||
$menu_options = array('basic' => 'Basic',
|
||||
# 'detail' => 'Detail',
|
||||
);
|
||||
|
||||
if (!$_GET['opta']) { $_GET['opta'] = "basic"; }
|
||||
@@ -10,10 +22,9 @@ if (!$_GET['opta']) { $_GET['opta'] = "basic"; }
|
||||
$sep = "";
|
||||
foreach ($menu_options as $option => $text)
|
||||
{
|
||||
if ($_GET['optb'] == $option) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo('<a href="device/' . $device['device_id'] . '/routing/vrf/' . $option . '/">' . $text
|
||||
. '</a>');
|
||||
if ($_GET['optb'] == $option) { echo("</span>"); }
|
||||
if ($vars['view'] == $option) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo(generate_link($text, $link_array,array('view'=>$option)));
|
||||
if ($vars['view'] == $option) { echo("</span>"); }
|
||||
echo(" | ");
|
||||
}
|
||||
|
||||
@@ -30,14 +41,14 @@ $graph_types = array("bits" => "Bits",
|
||||
foreach ($graph_types as $type => $descr)
|
||||
{
|
||||
echo("$type_sep");
|
||||
if ($_GET['optc'] == $type) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo('<a href="device/' . $device['device_id'] . '/routing/vrf/graphs/'.$type.'/">'.$descr.'</a>');
|
||||
if ($_GET['optc'] == $type) { echo("</span>"); }
|
||||
if ($vars['graph'] == $type) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo(generate_link($descr, $link_array,array('view'=>'graphs','graph'=>$type)));
|
||||
if ($vars['graph'] == $type) { echo("</span>"); }
|
||||
|
||||
# echo('(');
|
||||
# if ($_GET['optb'] == $type) { echo("<span class='pagemenu-selected'>"); }
|
||||
# if ($vars['view'] == $type) { echo("<span class='pagemenu-selected'>"); }
|
||||
# echo('<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/vrfs/'.$type.'/thumbs/">Mini</a>');
|
||||
# if ($_GET['optb'] == $type) { echo("</span>"); }
|
||||
# if ($vars['view'] == $type) { echo("</span>"); }
|
||||
# echo(')');
|
||||
$type_sep = " | ";
|
||||
}
|
||||
|
Reference in New Issue
Block a user