Files
librenms-librenms/includes/html/pages/routing.inc.php
Tony Murray 9ede688d13 Replace legacy menu with new Blade generated one (#10173)
* Remove legacy index php file

* fix routing page missing data

* WIP

* fix $navbar global usage

* remove global use of $locations

* ObjectCache again...

* move vars.inc.php to init.php for legacy ajax

* navbar is more local than I thought before.  Fix it.

* Fix some sensors tables escaping

* restore custom menu functionality, but with blade
and docs

* cleanup

* tidy menu @if checks

* Fix up the rest of the global variables and remove print-menubar.php

* consolidate some counting in the menu

* filter out empty custom port descr types

* Fix up custom port groups

* Fix up apps menu

* Fix services menu when all are ok

* Limit cached data to the user it is for

* Fix style

* A few clean ups

* fix pseudowire bug
2019-05-10 11:02:39 -05:00

73 lines
1.7 KiB
PHP

<?php
use App\Models\BgpPeer;
use App\Models\CefSwitching;
use App\Models\Component;
use App\Models\OspfInstance;
use App\Models\Vrf;
$pagetitle[] = 'Routing';
if ($_GET['optb'] == 'graphs' || $_GET['optc'] == 'graphs') {
$graphs = 'graphs';
} else {
$graphs = 'nographs';
}
$user = Auth::user();
$routing_count = \LibreNMS\Util\ObjectCache::routing();
// $datas[] = 'overview';
// $routing_count is populated by print-menubar.inc.php
// $type_text['overview'] = "Overview";
$type_text['bgp'] = 'BGP';
$type_text['cef'] = 'CEF';
$type_text['ospf'] = 'OSPF';
$type_text['vrf'] = 'VRFs';
$type_text['cisco-otv'] = 'OTV';
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
print_optionbar_end();
switch ($vars['protocol']) {
case 'overview':
case 'bgp':
case 'vrf':
case 'cef':
case 'ospf':
case 'cisco-otv':
include 'includes/html/pages/routing/'.$vars['protocol'].'.inc.php';
break;
default:
echo report_this('Unknown protocol '.$vars['protocol']);
break;
}