From 0572f4a031d759b7e83c4c5037813c6bdd899d4b Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Thu, 28 Apr 2011 15:01:36 +0000 Subject: [PATCH] move vrfs into routing for devices git-svn-id: http://www.observium.org/svn/observer/trunk@2197 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/print-vrf.inc.php | 6 +++--- html/pages/device.inc.php | 16 ++++++++-------- html/pages/device/routing.inc.php | 7 ++++++- .../device/{vrfs.inc.php => routing/vrf.inc.php} | 8 ++++---- 4 files changed, 21 insertions(+), 16 deletions(-) rename html/pages/device/{vrfs.inc.php => routing/vrf.inc.php} (78%) diff --git a/html/includes/print-vrf.inc.php b/html/includes/print-vrf.inc.php index a92c6ac9a8..eb366cfdc5 100644 --- a/html/includes/print-vrf.inc.php +++ b/html/includes/print-vrf.inc.php @@ -4,7 +4,7 @@ if (is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list echo(""); -echo("" . $vrf['vrf_name'] . ""); +echo("" . $vrf['vrf_name'] . ""); echo("" . $vrf['mplsVpnVrfDescription'] . ""); echo("" . $vrf['mplsVpnVrfRouteDistinguisher'] . ""); @@ -12,9 +12,9 @@ echo(''); $ports_query = mysql_query("SELECT * FROM ports WHERE `device_id` = '" . $device['device_id'] . "' AND `ifVrf` = '" . $vrf['vrf_id'] . "' "); while ($port = mysql_fetch_assoc($ports_query)) { - if ($_GET['opta'] == "graphs") + if ($_GET['optb'] == "graphs") { - $graph_type = "port_" . $_GET['optb']; + $graph_type = "port_" . $_GET['optc']; echo("
".makeshortif($port['ifDescr'])."
'); } - if (@mysql_result(mysql_query("select count(*) from vrfs WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') - { - echo('
  • - - VRFs - -
  • '); - } +# if (@mysql_result(mysql_query("select count(*) from vrfs WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') +# { +# echo('
  • +# +# VRFs +# +#
  • '); +# } diff --git a/html/pages/device/routing.inc.php b/html/pages/device/routing.inc.php index fbdd5b66c3..1b86de13ee 100644 --- a/html/pages/device/routing.inc.php +++ b/html/pages/device/routing.inc.php @@ -3,6 +3,11 @@ $datas[] = 'overview'; +if (@mysql_result(mysql_query("select count(*) from vrfs WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') +{ + $datas[] = 'vrf'; +} + $bgp_count = mysql_result(mysql_query("select count(*) from bgpPeers WHERE device_id = '" . $device['device_id'] . "'"), 0); if ($bgp_count) { $datas[] = 'bgp'; } @@ -12,11 +17,11 @@ if ($cef_count) { $datas[] = 'cef'; } $ospf_count = mysql_result(mysql_query("select count(*) from ospf_instances WHERE device_id = '" . $device['device_id'] . "'"), 0); if ($ospf_count) { $datas[] = 'ospf'; } - $type_text['overview'] = "Overview"; $type_text['bgp'] = "BGP"; $type_text['cef'] = "CEF"; $type_text['ospf'] = "OSPF"; +$type_text['vrf'] = "VRFs"; print_optionbar_start(); diff --git a/html/pages/device/vrfs.inc.php b/html/pages/device/routing/vrf.inc.php similarity index 78% rename from html/pages/device/vrfs.inc.php rename to html/pages/device/routing/vrf.inc.php index 647f6b6733..86d5ae12b3 100644 --- a/html/pages/device/vrfs.inc.php +++ b/html/pages/device/routing/vrf.inc.php @@ -12,7 +12,7 @@ foreach ($menu_options as $option => $text) { echo($sep); if ($_GET['opta'] == $option) { echo(""); } - echo('' . $text + echo('' . $text . ''); if ($_GET['opta'] == $option) { echo(""); } $sep = " | "; @@ -31,9 +31,9 @@ $graph_types = array("bits" => "Bits", foreach ($graph_types as $type => $descr) { echo("$type_sep"); - if ($_GET['optb'] == $type) { echo(""); } - echo(''.$descr.''); - if ($_GET['optb'] == $type) { echo(""); } + if ($_GET['optc'] == $type) { echo(""); } + echo(''.$descr.''); + if ($_GET['optc'] == $type) { echo(""); } # echo('('); # if ($_GET['optb'] == $type) { echo(""); }