mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
83 lines
1.9 KiB
PHP
83 lines
1.9 KiB
PHP
<?php
|
|
|
|
$link_array = [
|
|
'page' => 'device',
|
|
'device' => $device['device_id'],
|
|
'tab' => 'vlans',
|
|
];
|
|
|
|
print_optionbar_start();
|
|
|
|
echo "<span style='font-weight: bold;'>VLANs</span> » ";
|
|
|
|
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, ['view' => $option]);
|
|
if ($vars['view'] == $option) {
|
|
echo '</span>';
|
|
}
|
|
|
|
$sep = ' | ';
|
|
}
|
|
|
|
unset($sep);
|
|
|
|
echo ' | Graphs: ';
|
|
|
|
$graph_types = [
|
|
'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, ['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();
|
|
|
|
echo '<table border="0" cellspacing="0" cellpadding="5" width="100%">';
|
|
|
|
include 'includes/html/print-vlan.inc.php';
|
|
|
|
echo '</table>';
|
|
|
|
$pagetitle[] = 'VLANs';
|