From e14e179e3134dfac997a12cbcdd53d9a59969ad7 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Sun, 17 Apr 2011 15:55:38 +0000 Subject: [PATCH] fuck you, svn git-svn-id: http://www.observium.org/svn/observer/trunk@2089 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/print-menubar.php | 15 +++-- html/pages/device.inc.php | 13 +++- html/pages/device/routing.inc.php | 47 +++++++++++++ html/pages/device/{ => routing}/bgp.inc.php | 20 +++--- html/pages/routing.inc.php | 75 +++++++++++++++++++++ html/pages/{ => routing}/bgp.inc.php | 0 6 files changed, 152 insertions(+), 18 deletions(-) create mode 100644 html/pages/device/routing.inc.php rename html/pages/device/{ => routing}/bgp.inc.php (91%) create mode 100644 html/pages/routing.inc.php rename html/pages/{ => routing}/bgp.inc.php (100%) diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 177cb30879..530ae7be9d 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -229,21 +229,22 @@ if ($deleted_ports) { echo('
  • Routing +
  • Routing @@ -109,11 +109,11 @@ while ($peer = mysql_fetch_assoc($peer_query)) Updates " . $peer['bgpPeerInUpdates'] . " " . $peer['bgpPeerOutUpdates'] . ""); - 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"; diff --git a/html/pages/routing.inc.php b/html/pages/routing.inc.php new file mode 100644 index 0000000000..4da81eeb6d --- /dev/null +++ b/html/pages/routing.inc.php @@ -0,0 +1,75 @@ +"); + } + + echo('' . $type_text[$type] .""); + + if ($_GET['opta'] == $type) { echo(""); } + + $sep = ' | '; +} + +unset ($sep); + +echo('
    '); + +if ($_GET['optb'] == "graphs") +{ + echo(''); +} + +echo(' Graphs'); + +if ($_GET['optb'] == "graphs") +{ + echo(''); +} + +echo(' | '); + +if ($_GET['optb'] == "nographs") +{ + echo(''); +} + +echo(' No Graphs'); + +if ($_GET['optb'] == "nographs") +{ + echo(''); +} + +echo('
    '); + +print_optionbar_end(); + +switch ($_GET['opta']) +{ + case 'overview': + case 'bgp': + include('pages/routing/'.$_GET['opta'].'.inc.php'); + break; + default: + echo("

    Error. Please report this to observium developers.

    "); + break; +} + +?> diff --git a/html/pages/bgp.inc.php b/html/pages/routing/bgp.inc.php similarity index 100% rename from html/pages/bgp.inc.php rename to html/pages/routing/bgp.inc.php
      '); - - + ## BGP Sessions if ($_SESSION['userlevel'] >= '5' && (isset($config['enable_bgp']) && $config['enable_bgp'])) { echo(' -
    • All BGP Sessions
    • +
    •  BGP
    • +
    • All Sessions
    • -
    • External BGP
    • -
    • Internal BGP
    • '); +
    • External Sessions
    • +
    • Internal Sessions
    • '); - echo('

    • '); + echo(' +

    • '); } ## Do Alerts at the bottom diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index 2e8f801c78..11167d75e8 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -118,12 +118,23 @@ if (device_permitted($_GET['id']) || $check_device == $_GET['id']) '); } + + if ($config['enable_bgp'] && $device['bgpLocalAs']) { - echo('
    • + $bgp_menu = '
    • BGP +
    • '; + } + + if(isset($bgp_menu) || isset($ospf_menu) || isset($isis_menu) || isset($eigrp_menu) || isset($bgp_menu)) + { + echo('
    • + + Routing +
    • '); } diff --git a/html/pages/device/routing.inc.php b/html/pages/device/routing.inc.php new file mode 100644 index 0000000000..a79587d8ed --- /dev/null +++ b/html/pages/device/routing.inc.php @@ -0,0 +1,47 @@ +'); + } + + echo(" " . $type_text[$type] .""); + if ($_GET['opta'] == $type) { echo(""); } + $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"); + } + } +} + +?> diff --git a/html/pages/device/bgp.inc.php b/html/pages/device/routing/bgp.inc.php similarity index 91% rename from html/pages/device/bgp.inc.php rename to html/pages/device/routing/bgp.inc.php index 3b45b2f2d4..1aa0009571 100644 --- a/html/pages/device/bgp.inc.php +++ b/html/pages/device/routing/bgp.inc.php @@ -7,17 +7,17 @@ print_optionbar_start(); echo("
      - No Graphs | - Updates"); + No Graphs | + Updates"); echo(" | Prefixes: - IPv4 | - VPNv4 | - IPv6 + IPv4 | + VPNv4 | + IPv6 "); echo("| Traffic: - Mac Accounting"); + Mac Accounting"); echo("
      "); @@ -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 = "', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">" . $peer['bgpPeerIdentifier'] . ""; + $peeraddresslink = "', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">" . $peer['bgpPeerIdentifier'] . ""; echo("
    $i