mirror of
https://github.com/librenms/librenms.git
synced 2024-09-22 10:58:42 +00:00
fixes to BGP displaying. better way of pointing out alerted things? (bordercolour = OMGRED!!!1!!TWELVE)
git-svn-id: http://www.observium.org/svn/observer/trunk@2094 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
parent
75c1111d9c
commit
23a6293c27
@ -552,10 +552,11 @@ p.vspace { padding-top: 3px; padding-bottom: 3px; }
|
||||
#text { width: 1100px; }
|
||||
|
||||
#menubar ul { margin: 0px 10px; padding: 0px; }
|
||||
#menubar ul li { list-style: none; display: inline; text-indent: 0px; text-align: left; padding-right: 10px; }
|
||||
#menubar ul li { list-style: none; display: inline; text-indent: 0px; text-align: left; padding-right: 10px; color: #666; }
|
||||
#menubar a { color: #666; }
|
||||
|
||||
#popupmenu a { color: #aaa; }
|
||||
#popupmenu li { color: #aaa; }
|
||||
#popupmenu a:hover { color: #fff; }
|
||||
#popupmenu li:hover { background: #444; color: #eec; }
|
||||
#popupmenu li:hover ul { display: block; }
|
||||
|
BIN
html/images/1px-pink.png
Executable file
BIN
html/images/1px-pink.png
Executable file
Binary file not shown.
@ -237,16 +237,17 @@ if ($_SESSION['userlevel'] >= '5')
|
||||
if ($_SESSION['userlevel'] >= '5' && (isset($config['enable_bgp']) && $config['enable_bgp']))
|
||||
{
|
||||
echo('
|
||||
<li> BGP</li>
|
||||
<li><a href="bgp/"><img src="images/16/link.png" border="0" align="absmiddle" /> All Sessions </a></li>
|
||||
<li><a href="routing/bgp/all/nographs/"><img src="images/16/link.png" border="0" align="absmiddle" /> BGP All Sessions </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>');
|
||||
<li><a href="routing/bgp/external/nographs/"><img src="images/16/world_link.png" border="0" align="absmiddle" /> BGP External</a></li>
|
||||
<li><a href="routing/bgp/internal/nographs/"><img src="images/16/brick_link.png" border="0" align="absmiddle" /> BGP Internal</a></li>');
|
||||
|
||||
echo('
|
||||
<li><hr /></li>');
|
||||
<li><hr width=140></li>');
|
||||
}
|
||||
|
||||
$routing_alert_sep = "";
|
||||
|
||||
## Do Alerts at the bottom
|
||||
if ($bgp_alerts)
|
||||
{
|
||||
|
@ -1,58 +1,68 @@
|
||||
<?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"; }
|
||||
if ($_GET['optb'] == "graphs" || $_GET['optc'] == "graphs") { $graphs = "graphs"; } else { $graphs = "nographs"; }
|
||||
|
||||
print_optionbar_start('', '');
|
||||
|
||||
$sep = "";
|
||||
foreach ($datas as $texttype)
|
||||
{
|
||||
$type = strtolower($texttype);
|
||||
echo($sep);
|
||||
if ($_GET['opta'] == $type)
|
||||
{
|
||||
echo("<span class='pagemenu-selected'>");
|
||||
}
|
||||
if ($_GET['opta'] == "overview") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo('<a href="routing/overview/'.$graphs.'/">Overview</a>');
|
||||
if ($_GET['opta'] == "overview") { echo("</span>"); }
|
||||
|
||||
echo('<a href="'.$config['base_url'].'/routing/' . $type . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/">' . $type_text[$type] ."</a>");
|
||||
echo(" | ");
|
||||
|
||||
if ($_GET['opta'] == $type) { echo("</span>"); }
|
||||
## Start BGP Menu -- FIXME only show if BGP enabled?
|
||||
if ($_GET['opta'] == "bgp" && $_GET['optb'] == "all") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo('<a href="routing/bgp/all/'.$graphs.'/">BGP</a>');
|
||||
if ($_GET['opta'] == "bgp" && $_GET['optb'] == "all") { echo("</span>"); }
|
||||
echo('(');
|
||||
if ($_GET['opta'] == "bgp" && $_GET['optb'] == "internal") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo('<a href="routing/bgp/internal/'.$graphs.'/">Internal</a>');
|
||||
if ($_GET['opta'] == "bgp" && $_GET['optb'] == "internal") { echo("</span>"); }
|
||||
echo("|");
|
||||
if ($_GET['opta'] == "bgp" && $_GET['optb'] == "external") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo('<a href="routing/bgp/external/'.$graphs.'/">External</a>');
|
||||
if ($_GET['opta'] == "bgp" && $_GET['optb'] == "external") { echo("</span>"); }
|
||||
echo(')');
|
||||
## End BGP Menu
|
||||
|
||||
$sep = ' | ';
|
||||
}
|
||||
|
||||
unset ($sep);
|
||||
if(!isset($graphs)) { $graphs == "nographs"; }
|
||||
|
||||
echo('<div style="float: right;">');
|
||||
|
||||
if ($_GET['optb'] == "graphs")
|
||||
if ($graphs == "graphs")
|
||||
{
|
||||
echo('<span class="pagemenu-selected">');
|
||||
}
|
||||
|
||||
if(isset($_GET['optc']))
|
||||
{
|
||||
echo('<a href="routing/'. $_GET['opta'].'/graphs/"> Graphs</a>');
|
||||
} else {
|
||||
echo('<a href="routing/'. $_GET['opta'].'/'.$_GET['optb'].'/graphs/"> Graphs</a>');
|
||||
}
|
||||
|
||||
if ($_GET['optb'] == "graphs")
|
||||
if ($graphs == "graphs")
|
||||
{
|
||||
echo('</span>');
|
||||
}
|
||||
|
||||
echo(' | ');
|
||||
|
||||
if ($_GET['optb'] == "nographs")
|
||||
if ($graphs == "nographs")
|
||||
{
|
||||
echo('<span class="pagemenu-selected">');
|
||||
}
|
||||
|
||||
if(isset($_GET['optc']))
|
||||
{
|
||||
echo('<a href="routing/'. $_GET['opta'].'/nographs/"> No Graphs</a>');
|
||||
} else {
|
||||
echo('<a href="routing/'. $_GET['opta'].'/'.$_GET['optb'].'/nographs/"> No Graphs</a>');
|
||||
}
|
||||
|
||||
if ($_GET['optb'] == "nographs")
|
||||
if ($graphs == "nographs")
|
||||
{
|
||||
echo('</span>');
|
||||
}
|
||||
|
@ -23,11 +23,11 @@ else
|
||||
$peer_query = mysql_query("select * from bgpPeers AS B, devices AS D WHERE B.device_id = D.device_id $where ORDER BY D.hostname, B.bgpPeerRemoteAs, B.bgpPeerIdentifier");
|
||||
while ($peer = mysql_fetch_assoc($peer_query))
|
||||
{
|
||||
unset($bg_image);
|
||||
unset ($alert, $bg_image);
|
||||
|
||||
if (!is_integer($i/2)) { $bg_colour = $list_colour_b; } else { $bg_colour = $list_colour_a; }
|
||||
|
||||
if ($peer['bgpPeerState'] == "established") { $col = "green"; } else { $col = "red"; if ($_GET['opta'] != "alerts") { $bg_image = "images/warning-background.png"; } }
|
||||
if ($peer['bgpPeerState'] == "established") { $col = "green"; } else { $col = "red"; if ($_GET['optb'] != "alerts") { $alert=1; $bg_image = "images/1px-pink.png"; } }
|
||||
if ($peer['bgpPeerAdminStatus'] == "start" || $peer['bgpPeerAdminStatus'] == "running") { $admin_col = "green"; } else { $admin_col = "gray"; }
|
||||
|
||||
if ($peer['bgpPeerRemoteAs'] == $peer['bgpLocalAs']) { $peer_type = "<span style='color: #00f;'>iBGP</span>"; } else { $peer_type = "<span style='color: #0a0;'>eBGP</span>";
|
||||
@ -48,7 +48,7 @@ else
|
||||
$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>";
|
||||
|
||||
echo('<tr bgcolor="'.$bg_colour.'"' . ($bg_image ? ' background="'.$bg_image.'"' : '') . ">
|
||||
echo('<tr bgcolor="'.$bg_colour.'"' . ($alert ? ' bordercolor="#cc0000"' : '') . ">
|
||||
<td></td>
|
||||
<td width=150>" . $localaddresslink . "<br />".generate_device_link($peer, shorthost($peer['hostname']), 'bgp/')."</td>
|
||||
<td width=30>-></td>
|
||||
@ -60,32 +60,18 @@ else
|
||||
Updates <img src='images/16/arrow_down.png' align=absmiddle /> " . format_si($peer['bgpPeerInUpdates']) . "
|
||||
<img src='images/16/arrow_up.png' align=absmiddle /> " . format_si($peer['bgpPeerOutUpdates']) . "</td></tr>");
|
||||
|
||||
if ($graphs)
|
||||
|
||||
if($graphs == "graphs")
|
||||
{
|
||||
$graph_type = "bgpupdates";
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "215";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $peer['bgpPeer_id'];
|
||||
$graph_array['type'] = "bgp_updates";
|
||||
|
||||
$daily_traffic = "graph.php?peer=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$day&to=$now&width=210&height=100";
|
||||
$daily_url = "graph.php?peer=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$day&to=$now&width=500&height=150";
|
||||
echo('<tr bgcolor="'.$bg_colour.'"' . ($bg_image ? ' background="'.$bg_image.'"' : '') . '"><td colspan="8">');
|
||||
|
||||
$weekly_traffic = "graph.php?peer=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$week&to=$now&width=210&height=100";
|
||||
$weekly_url = "graph.php?peer=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$week&to=$now&width=500&height=150";
|
||||
|
||||
$monthly_traffic = "graph.php?peer=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$month&to=$now&width=210&height=100";
|
||||
$monthly_url = "graph.php?peer=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$month&to=$now&width=500&height=150";
|
||||
|
||||
$yearly_traffic = "graph.php?peer=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$year&to=$now&width=210&height=100";
|
||||
$yearly_url = "graph.php?peer=" . $peer['bgpPeer_id'] . "&type=$graph_type&from=$year&to=$now&width=500&height=150";
|
||||
|
||||
echo("<tr><td colspan=6>");
|
||||
|
||||
echo("<a href='?page=interface&id=" . $peer['bgpPeer_id'] . "' onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_traffic' border=0></a> ");
|
||||
echo("<a href='?page=interface&id=" . $peer['bgpPeer_id'] . "' onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_traffic' border=0></a> ");
|
||||
echo("<a href='?page=interface&id=" . $peer['bgpPeer_id'] . "' onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_traffic' border=0></a> ");
|
||||
echo("<a href='?page=interface&id=" . $peer['bgpPeer_id'] . "' onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_traffic' border=0></a>");
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user