Files

75 lines
1.7 KiB
PHP
Raw Permalink Normal View History

2011-04-17 15:55:38 +00:00
<?php
use App\Models\BgpPeer;
use App\Models\CefSwitching;
use App\Models\Component;
use App\Models\OspfInstance;
use App\Models\Vrf;
$pagetitle[] = 'Routing';
2011-10-18 14:41:19 +00:00
if ($_GET['optb'] == 'graphs' || $_GET['optc'] == 'graphs') {
$graphs = 'graphs';
2016-08-18 20:28:22 -05:00
} else {
$graphs = 'nographs';
}
2011-04-17 15:55:38 +00:00
$user = Auth::user();
$routing_count = \LibreNMS\Util\ObjectCache::routing();
// $datas[] = 'overview';
2012-05-25 12:24:34 +00:00
// $routing_count is populated by print-menubar.inc.php
// $type_text['overview'] = "Overview";
$type_text['bgp'] = 'BGP';
$type_text['cef'] = 'CEF';
2019-06-06 23:12:13 +02:00
$type_text['mpls'] = 'MPLS';
$type_text['ospf'] = 'OSPF';
$type_text['vrf'] = 'VRFs';
2016-01-21 22:04:20 +10:00
$type_text['cisco-otv'] = 'OTV';
2011-04-29 16:32:55 +00:00
print_optionbar_start();
// if (!$vars['protocol']) { $vars['protocol'] = "overview"; }
echo "<span style='font-weight: bold;'>Routing</span> &#187; ";
$vars['protocol'] = basename($vars['protocol']);
$sep = '';
foreach ($routing_count as $type => $value) {
if (!$vars['protocol']) {
$vars['protocol'] = $type;
}
echo $sep;
unset($sep);
if ($vars['protocol'] == $type) {
echo '<span class="pagemenu-selected">';
}
if ($routing_count[$type]) {
echo generate_link($type_text[$type].' ('.$routing_count[$type].')', array('page' => 'routing', 'protocol' => $type));
$sep = ' | ';
}
if ($vars['protocol'] == $type) {
echo '</span>';
}
}//end foreach
2011-04-17 15:55:38 +00:00
2011-04-29 16:32:55 +00:00
print_optionbar_end();
2011-04-17 15:55:38 +00:00
switch ($vars['protocol']) {
case 'overview':
case 'bgp':
case 'vrf':
case 'cef':
2019-06-06 23:12:13 +02:00
case 'mpls':
case 'ospf':
2016-01-21 22:04:20 +10:00
case 'cisco-otv':
2019-04-11 23:26:42 -05:00
include 'includes/html/pages/routing/'.$vars['protocol'].'.inc.php';
2016-08-18 20:28:22 -05:00
break;
default:
echo report_this('Unknown protocol '.$vars['protocol']);
2016-08-18 20:28:22 -05:00
break;
2011-04-17 15:55:38 +00:00
}