fixup device vlan tab

git-svn-id: http://www.observium.org/svn/observer/trunk@2596 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-09-27 13:04:04 +00:00
parent b207e0e1b9
commit ae558c7dbd
4 changed files with 52 additions and 12 deletions

View File

@ -10,10 +10,8 @@ echo("<td class=list-bold>");
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("<div style='display: block; padding: 2px; margin: 2px; min-width: 139px; max-width:139px; min-height:85px; max-height:85px; text-align: center; float: left; background-color: ".$list_colour_b_b.";'>
<div style='font-weight: bold;'>".makeshortif($port['ifDescr'])."</div>
<a href='device/device=".$device['device_id']."/tab=port/port=".$port['interface_id']."/' onmouseover=\"return overlib('\

View File

@ -54,7 +54,7 @@ foreach ($graph_types as $type => $descr)
echo(generate_link($descr,$link_array,array('view'=>'graphs','graph'=>$type)));
if ($vars['graph'] == $type && $vars['view'] == "graphs") { echo("</span>"); }
echo('(');
echo(' (');
if ($vars['graph'] == $type && $vars['view'] == "minigraphs") { echo("<span class='pagemenu-selected'>"); }
echo(generate_link('Mini',$link_array,array('view'=>'minigraphs','graph'=>$type)));
if ($vars['graph'] == $type && $vars['view'] == "minigraphs") { echo("</span>"); }

View File

@ -1,16 +1,58 @@
<?php
$link_array = array('page' => 'device',
'device' => $device['device_id'],
'tab' => 'vlans');
print_optionbar_start();
echo("<span style='font-weight: bold;'>VLANs</span> &#187; ");
echo('
<a href="device/device=' . $device['device_id'] . '/tab=vlans/">Basic</a> | Graphs :
<a href="device/device=' . $device['device_id'] . '/tab=vlans/view=bits/">Bits</a> |
<a href="device/device=' . $device['device_id'] . '/tab=vlans/view=pkts/">Packets</a> |
<a href="device/device=' . $device['device_id'] . '/tab=vlans/view=nupkts/">NU Packets</a> |
<a href="device/device=' . $device['device_id'] . '/tab=vlans/view=errors/">Errors</a>
');
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("<span class='pagemenu-selected'>"); }
echo(generate_link($text,$link_array,array('view'=>$option)));
if ($vars['view'] == $option) { echo("</span>"); }
$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("<span class='pagemenu-selected'>"); }
echo(generate_link($descr,$link_array,array('view'=>'graphs','graph'=>$type)));
if ($vars['graph'] == $type && $vars['view'] == "graphs") { echo("</span>"); }
/*
echo(' (');
if ($vars['graph'] == $type && $vars['type'] == "minigraphs") { echo("<span class='pagemenu-selected'>"); }
echo(generate_link('Mini',$link_array,array('type'=>'minigraphs','graph'=>$type)));
if ($vars['graph'] == $type && $vars['type'] == "minigraphs") { echo("</span>"); }
echo(')');
*/
$type_sep = " | ";
}
print_optionbar_end();

View File

@ -42,7 +42,7 @@ else
echo(generate_link("Shutdown",$vars, array('adminstatus' => 'stop')));
}
echo("|");
echo(" | ");
if ($vars['adminstatus'] == "start")
{