From 23a6293c2793e46d397fe8a505a09e83756442b4 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Mon, 18 Apr 2011 11:28:42 +0000 Subject: [PATCH] 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 --- html/css/styles.css | 5 ++- html/images/1px-pink.png | Bin 0 -> 957 bytes html/includes/print-menubar.php | 11 +++--- html/pages/routing.inc.php | 64 ++++++++++++++++++-------------- html/pages/routing/bgp.inc.php | 38 ++++++------------- 5 files changed, 58 insertions(+), 60 deletions(-) create mode 100755 html/images/1px-pink.png diff --git a/html/css/styles.css b/html/css/styles.css index 955f3d4f3..88c2444aa 100644 --- a/html/css/styles.css +++ b/html/css/styles.css @@ -552,15 +552,16 @@ 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; } #popupmenu ul { padding: 0px; margin: 0px; list-style: none; } -#popupmenu ul li { padding: 0px 8px; float: left; position: relative; } +#popupmenu ul li { padding: 0px 8px; float: left; position: relative;} #popupmenu li ul { display: none; diff --git a/html/images/1px-pink.png b/html/images/1px-pink.png new file mode 100755 index 0000000000000000000000000000000000000000..bb43b2168f8c2b95e0369f51a831ff17de90d6a8 GIT binary patch literal 957 ScmZQz7zLvtFd70wG6Vnvy#N6K literal 0 HcmV?d00001 diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 530ae7be9..6e6c9c696 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -237,16 +237,17 @@ if ($_SESSION['userlevel'] >= '5') if ($_SESSION['userlevel'] >= '5' && (isset($config['enable_bgp']) && $config['enable_bgp'])) { echo(' -
  •  BGP
  • -
  • All Sessions
  • +
  • BGP All Sessions
  • -
  • External Sessions
  • -
  • Internal Sessions
  • '); +
  • BGP External
  • +
  • BGP Internal
  • '); echo(' -

  • '); +

  • '); } + $routing_alert_sep = ""; + ## Do Alerts at the bottom if ($bgp_alerts) { diff --git a/html/pages/routing.inc.php b/html/pages/routing.inc.php index 4da81eeb6..b13101b65 100644 --- a/html/pages/routing.inc.php +++ b/html/pages/routing.inc.php @@ -1,58 +1,68 @@ "); - } + if ($_GET['opta'] == "overview") { echo(""); } + echo('Overview'); + if ($_GET['opta'] == "overview") { echo(""); } - echo('' . $type_text[$type] .""); - - if ($_GET['opta'] == $type) { echo(""); } + echo(" | "); - $sep = ' | '; -} + ## Start BGP Menu -- FIXME only show if BGP enabled? + if ($_GET['opta'] == "bgp" && $_GET['optb'] == "all") { echo(""); } + echo('BGP'); + if ($_GET['opta'] == "bgp" && $_GET['optb'] == "all") { echo(""); } + echo('('); + if ($_GET['opta'] == "bgp" && $_GET['optb'] == "internal") { echo(""); } + echo('Internal'); + if ($_GET['opta'] == "bgp" && $_GET['optb'] == "internal") { echo(""); } + echo("|"); + if ($_GET['opta'] == "bgp" && $_GET['optb'] == "external") { echo(""); } + echo('External'); + if ($_GET['opta'] == "bgp" && $_GET['optb'] == "external") { echo(""); } + echo(')'); + ## End BGP Menu -unset ($sep); + +if(!isset($graphs)) { $graphs == "nographs"; } echo('
    '); -if ($_GET['optb'] == "graphs") +if ($graphs == "graphs") { echo(''); } -echo(' Graphs'); +if(isset($_GET['optc'])) +{ + echo(' Graphs'); +} else { + echo(' Graphs'); +} -if ($_GET['optb'] == "graphs") +if ($graphs == "graphs") { echo(''); } echo(' | '); -if ($_GET['optb'] == "nographs") +if ($graphs == "nographs") { echo(''); } -echo(' No Graphs'); +if(isset($_GET['optc'])) +{ + echo(' No Graphs'); +} else { + echo(' No Graphs'); +} -if ($_GET['optb'] == "nographs") +if ($graphs == "nographs") { echo(''); } diff --git a/html/pages/routing/bgp.inc.php b/html/pages/routing/bgp.inc.php index 788a09a7a..c255f3a22 100644 --- a/html/pages/routing/bgp.inc.php +++ b/html/pages/routing/bgp.inc.php @@ -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 = "iBGP"; } else { $peer_type = "eBGP"; @@ -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 = "', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">" . $peer['bgpPeerIdentifier'] . ""; - echo(' + echo(' " . $localaddresslink . "
    ".generate_device_link($peer, shorthost($peer['hostname']), 'bgp/')." -> @@ -60,32 +60,18 @@ else Updates " . format_si($peer['bgpPeerInUpdates']) . " " . format_si($peer['bgpPeerOutUpdates']) . ""); - 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(''); - $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(""); - - echo("', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"> - "); - echo("', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"> - "); - echo("', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\"> - "); - echo("', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\"> - "); + include("includes/print-quadgraphs.inc.php"); echo(""); }