mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fuck you, svn
git-svn-id: http://www.observium.org/svn/observer/trunk@2089 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -229,21 +229,22 @@ if ($deleted_ports) { echo('<li><a href="ports/deleted/"><img src="images/16/cro
|
||||
if ($_SESSION['userlevel'] >= '5')
|
||||
{
|
||||
echo('
|
||||
<li><a class="menu2four" href="routing/"><img src="images/16/arrow_branch.png" border="0" align="absmiddle" /> Routing</a>
|
||||
<li><a class="menu2four" href="routing/"><img src="images/16/arrow_branch.png" border="0" align="absmiddle" />Routing</a>
|
||||
<table><tr><td>
|
||||
<ul>');
|
||||
|
||||
|
||||
|
||||
## BGP Sessions
|
||||
if ($_SESSION['userlevel'] >= '5' && (isset($config['enable_bgp']) && $config['enable_bgp']))
|
||||
{
|
||||
echo('
|
||||
<li><a href="bgp/"><img src="images/16/link.png" border="0" align="absmiddle" /> All BGP Sessions </a></li>
|
||||
<li> BGP</li>
|
||||
<li><a href="bgp/"><img src="images/16/link.png" border="0" align="absmiddle" /> All Sessions </a></li>
|
||||
|
||||
<li><a href="bgp/external/"><img src="images/16/world_link.png" border="0" align="absmiddle" /> External BGP</a></li>
|
||||
<li><a href="bgp/internal/"><img src="images/16/brick_link.png" border="0" align="absmiddle" /> Internal BGP</a></li>');
|
||||
<li><a href="bgp/external/"><img src="images/16/world_link.png" border="0" align="absmiddle" /> External Sessions</a></li>
|
||||
<li><a href="bgp/internal/"><img src="images/16/brick_link.png" border="0" align="absmiddle" /> Internal Sessions</a></li>');
|
||||
|
||||
echo(' <li><hr /></li>');
|
||||
echo('
|
||||
<li><hr /></li>');
|
||||
}
|
||||
|
||||
## Do Alerts at the bottom
|
||||
|
@@ -118,12 +118,23 @@ if (device_permitted($_GET['id']) || $check_device == $_GET['id'])
|
||||
</li>');
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($config['enable_bgp'] && $device['bgpLocalAs'])
|
||||
{
|
||||
echo('<li class="' . $select['bgp'] . '">
|
||||
$bgp_menu = '<li class="' . $select['bgp'] . '">
|
||||
<a href="device/' . $device['device_id'] . '/bgp/">
|
||||
<img src="images/16/link.png" align="absmiddle" border="0" /> BGP
|
||||
</a>
|
||||
</li>';
|
||||
}
|
||||
|
||||
if(isset($bgp_menu) || isset($ospf_menu) || isset($isis_menu) || isset($eigrp_menu) || isset($bgp_menu))
|
||||
{
|
||||
echo('<li class="' . $select['routing'] . '">
|
||||
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/routing/">
|
||||
<img src="images/16/arrow_branch.png" align="absmiddle" border="0" /> Routing
|
||||
</a>
|
||||
</li>');
|
||||
}
|
||||
|
||||
|
47
html/pages/device/routing.inc.php
Normal file
47
html/pages/device/routing.inc.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
$bgp_count = mysql_result(mysql_query("select count(*) from bgpPeers WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
|
||||
$datas[] = 'overview';
|
||||
if ($bgp_count) { $datas[] = 'bgp'; }
|
||||
|
||||
$type_text['overview'] = "Overview";
|
||||
$type_text['bgp'] = "BGP";
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
if (!$_GET['opta']) { $_GET['opta'] = "overview"; }
|
||||
|
||||
unset($sep);
|
||||
foreach ($datas as $type)
|
||||
{
|
||||
echo($sep);
|
||||
|
||||
if ($_GET['opta'] == $type)
|
||||
{
|
||||
echo('<span class="pagemenu-selected">');
|
||||
}
|
||||
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/routing/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $type_text[$type] ."</a>");
|
||||
if ($_GET['opta'] == $type) { echo("</span>"); }
|
||||
$sep = " | ";
|
||||
}
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if (is_file("pages/device/routing/".mres($_GET['opta']).".inc.php"))
|
||||
{
|
||||
include("pages/device/routing/".mres($_GET['opta']).".inc.php");
|
||||
} else {
|
||||
foreach ($datas as $type)
|
||||
{
|
||||
if ($type != "overview")
|
||||
{
|
||||
$graph_title = $type_text[$type];
|
||||
$graph_type = "device_".$type;
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -7,17 +7,17 @@ print_optionbar_start();
|
||||
|
||||
echo("
|
||||
<div style='margin: auto; text-align: left; padding-left: 11px; clear: both; display:block; height:20px;'>
|
||||
<a href='device/" . $device['device_id'] . "/bgp/'>No Graphs</a> |
|
||||
<a href='device/" . $device['device_id'] . "/bgp/updates/'>Updates</a>");
|
||||
<a href='/device/" . $device['device_id'] . "/routing/bgp/'>No Graphs</a> |
|
||||
<a href='/device/" . $device['device_id'] . "/routing/bgp/updates/'>Updates</a>");
|
||||
|
||||
echo(" | Prefixes:
|
||||
<a href='device/" . $device['device_id'] . "/bgp/prefixes/ipv4.unicast/'>IPv4</a> |
|
||||
<a href='device/" . $device['device_id'] . "/bgp/prefixes/ipv4.vpn/'>VPNv4</a> |
|
||||
<a href='device/" . $device['device_id'] . "/bgp/prefixes/ipv6.unicast/'>IPv6</a>
|
||||
<a href='/device/" . $device['device_id'] . "/routing/bgp/prefixes/ipv4.unicast/'>IPv4</a> |
|
||||
<a href='/device/" . $device['device_id'] . "/routing/bgp/prefixes/ipv4.vpn/'>VPNv4</a> |
|
||||
<a href='/device/" . $device['device_id'] . "/routing/bgp/prefixes/ipv6.unicast/'>IPv6</a>
|
||||
");
|
||||
|
||||
echo("| Traffic:
|
||||
<a href='device/" . $device['device_id'] . "/bgp/macaccounting/'>Mac Accounting</a>");
|
||||
<a href='/device/" . $device['device_id'] . "/routing/bgp/macaccounting/'>Mac Accounting</a>");
|
||||
|
||||
echo("</div>
|
||||
");
|
||||
@@ -96,7 +96,7 @@ while ($peer = mysql_fetch_assoc($peer_query))
|
||||
|
||||
$graph_type = "bgp_updates";
|
||||
$peer_daily_url = "graph.php?id=" . $peer['bgpPeer_id'] . "&type=" . $graph_type . "&from=$day&to=$now&width=500&height=150";
|
||||
$peeraddresslink = "<span class=list-large><a href='device/" . $peer['device_id'] . "/bgp/updates/' onmouseover=\"return overlib('<img src=\'$peer_daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">" . $peer['bgpPeerIdentifier'] . "</a></span>";
|
||||
$peeraddresslink = "<span class=list-large><a href='device/" . $peer['device_id'] . "/routing/bgp/updates/' onmouseover=\"return overlib('<img src=\'$peer_daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">" . $peer['bgpPeerIdentifier'] . "</a></span>";
|
||||
|
||||
echo("<tr bgcolor=$bg_colour background=$bg_image>
|
||||
<td width=20><span class=list-large>$i</span></td>
|
||||
@@ -109,11 +109,11 @@ while ($peer = mysql_fetch_assoc($peer_query))
|
||||
Updates <img src='images/16/arrow_down.png' align=absmiddle> " . $peer['bgpPeerInUpdates'] . "
|
||||
<img src='images/16/arrow_up.png' align=absmiddle> " . $peer['bgpPeerOutUpdates'] . "</td></tr>");
|
||||
|
||||
if (isset($_GET['opta']) && $_GET['opta'] != "macaccounting")
|
||||
if (isset($_GET['optb']) && $_GET['optb'] != "macaccounting")
|
||||
{
|
||||
foreach (explode(" ", $_GET['opta']) as $graph_type)
|
||||
foreach (explode(" ", $_GET['optb']) as $graph_type)
|
||||
{
|
||||
if ($graph_type == "prefixes") { list($afi, $safi) = explode(".", $_GET['optb']); $afisafi = "&afi=$afi&safi=$safi"; }
|
||||
if ($graph_type == "prefixes") { list($afi, $safi) = explode(".", $_GET['optc']); $afisafi = "&afi=$afi&safi=$safi"; }
|
||||
if ($graph_type == "updates" || $valid_afi_safi[$afi][$safi])
|
||||
{
|
||||
$daily_traffic = $config['base_url'] . "/graph.php?id=" . $peer['bgpPeer_id'] . "&type=bgp_$graph_type&from=$day&to=$now&width=210&height=100$afisafi";
|
75
html/pages/routing.inc.php
Normal file
75
html/pages/routing.inc.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
$datas = array('overview', 'bgp');
|
||||
|
||||
$type_text['overview'] = "Overview";
|
||||
$type_text['bgp'] = "BGP";
|
||||
|
||||
if (!$_GET['opta']) { $_GET['opta'] = "overview"; }
|
||||
if (!$_GET['optb']) { $_GET['optb'] = "nographs"; }
|
||||
|
||||
print_optionbar_start('', '');
|
||||
|
||||
$sep = "";
|
||||
foreach ($datas as $texttype)
|
||||
{
|
||||
$type = strtolower($texttype);
|
||||
echo($sep);
|
||||
if ($_GET['opta'] == $type)
|
||||
{
|
||||
echo("<span class='pagemenu-selected'>");
|
||||
}
|
||||
|
||||
echo('<a href="'.$config['base_url'].'/routing/' . $type . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/">' . $type_text[$type] ."</a>");
|
||||
|
||||
if ($_GET['opta'] == $type) { echo("</span>"); }
|
||||
|
||||
$sep = ' | ';
|
||||
}
|
||||
|
||||
unset ($sep);
|
||||
|
||||
echo('<div style="float: right;">');
|
||||
|
||||
if ($_GET['optb'] == "graphs")
|
||||
{
|
||||
echo('<span class="pagemenu-selected">');
|
||||
}
|
||||
|
||||
echo('<a href="routing/'. $_GET['opta'].'/graphs/"> Graphs</a>');
|
||||
|
||||
if ($_GET['optb'] == "graphs")
|
||||
{
|
||||
echo('</span>');
|
||||
}
|
||||
|
||||
echo(' | ');
|
||||
|
||||
if ($_GET['optb'] == "nographs")
|
||||
{
|
||||
echo('<span class="pagemenu-selected">');
|
||||
}
|
||||
|
||||
echo('<a href="routing/'. $_GET['opta'].'/nographs/"> No Graphs</a>');
|
||||
|
||||
if ($_GET['optb'] == "nographs")
|
||||
{
|
||||
echo('</span>');
|
||||
}
|
||||
|
||||
echo('</div>');
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
switch ($_GET['opta'])
|
||||
{
|
||||
case 'overview':
|
||||
case 'bgp':
|
||||
include('pages/routing/'.$_GET['opta'].'.inc.php');
|
||||
break;
|
||||
default:
|
||||
echo("<h2>Error. Please report this to observium developers.</h2>");
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user