From ae558c7dbd76e8b8180e90a8b8fe07c72d931c2d Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Tue, 27 Sep 2011 13:04:04 +0000 Subject: [PATCH] fixup device vlan tab git-svn-id: http://www.observium.org/svn/observer/trunk@2596 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/print-vlan.inc.php | 4 +-- html/pages/device/ports.inc.php | 2 +- html/pages/device/vlans.inc.php | 56 ++++++++++++++++++++++++++++---- html/pages/routing/bgp.inc.php | 2 +- 4 files changed, 52 insertions(+), 12 deletions(-) diff --git a/html/includes/print-vlan.inc.php b/html/includes/print-vlan.inc.php index 962ec8d67..e85f56bb7 100644 --- a/html/includes/print-vlan.inc.php +++ b/html/includes/print-vlan.inc.php @@ -10,10 +10,8 @@ echo(""); foreach (dbFetchRows("SELECT * FROM ports WHERE `device_id` = ? AND `ifVlan` = ?", array($device['device_id'], $vlan['vlan_vlan'])) as $port) { - if ($vars['view']) + if ($vars['view'] == "graphs") { - $graph_type = 'port_' . $vars['view']; - echo("
".makeshortif($port['ifDescr'])."
$descr) echo(generate_link($descr,$link_array,array('view'=>'graphs','graph'=>$type))); if ($vars['graph'] == $type && $vars['view'] == "graphs") { echo(""); } - echo('('); + echo(' ('); if ($vars['graph'] == $type && $vars['view'] == "minigraphs") { echo(""); } echo(generate_link('Mini',$link_array,array('view'=>'minigraphs','graph'=>$type))); if ($vars['graph'] == $type && $vars['view'] == "minigraphs") { echo(""); } diff --git a/html/pages/device/vlans.inc.php b/html/pages/device/vlans.inc.php index 4cb79628e..932b80a82 100644 --- a/html/pages/device/vlans.inc.php +++ b/html/pages/device/vlans.inc.php @@ -1,16 +1,58 @@ 'device', + 'device' => $device['device_id'], + 'tab' => 'vlans'); + print_optionbar_start(); echo("VLANs » "); -echo(' - Basic | Graphs : - Bits | - Packets | - NU Packets | - Errors - '); +if ($vars['view'] == 'graphs' || $vars['view'] == 'minigraphs') +{ + if (isset($vars['graph'])) { $graph_type = "port_" . $vars['graph']; } else { $graph_type = "port_bits"; } +} + +if (!$vars['view']) { $vars['view'] = "basic"; } + +$menu_options['basic'] = 'Basic'; +#$menu_options['details'] = 'Details'; + +$sep = ""; +foreach ($menu_options as $option => $text) +{ + echo($sep); + if ($vars['view'] == $option) { echo(""); } + echo(generate_link($text,$link_array,array('view'=>$option))); + if ($vars['view'] == $option) { echo(""); } + $sep = " | "; +} + +unset($sep); + +echo(' | Graphs: '); + +$graph_types = array("bits" => "Bits", + "upkts" => "Unicast Packets", + "nupkts" => "Non-Unicast Packets", + "errors" => "Errors"); + +foreach ($graph_types as $type => $descr) +{ + echo("$type_sep"); + if ($vars['graph'] == $type && $vars['view'] == "graphs") { echo(""); } + echo(generate_link($descr,$link_array,array('view'=>'graphs','graph'=>$type))); + if ($vars['graph'] == $type && $vars['view'] == "graphs") { echo(""); } + +/* + echo(' ('); + if ($vars['graph'] == $type && $vars['type'] == "minigraphs") { echo(""); } + echo(generate_link('Mini',$link_array,array('type'=>'minigraphs','graph'=>$type))); + if ($vars['graph'] == $type && $vars['type'] == "minigraphs") { echo(""); } + echo(')'); +*/ + $type_sep = " | "; +} print_optionbar_end(); diff --git a/html/pages/routing/bgp.inc.php b/html/pages/routing/bgp.inc.php index 3670b5ac2..bba1a57a4 100644 --- a/html/pages/routing/bgp.inc.php +++ b/html/pages/routing/bgp.inc.php @@ -42,7 +42,7 @@ else echo(generate_link("Shutdown",$vars, array('adminstatus' => 'stop'))); } - echo("|"); + echo(" | "); if ($vars['adminstatus'] == "start") {