mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix to show Routing Count in Pagemenu Selector (#12111)
This commit is contained in:
@@ -38,15 +38,15 @@ class RoutingController implements DeviceTab
|
||||
{
|
||||
$device = DeviceCache::getPrimary();
|
||||
$this->tabs = [
|
||||
'ospf' => $device->ospfInstances()->exists(),
|
||||
'bgp' => $device->bgppeers()->exists(),
|
||||
'vrf' => $device->vrfs()->exists(),
|
||||
'cef' => $device->cefSwitching()->exists(),
|
||||
'mpls' => $device->mplsLsps()->exists(),
|
||||
'cisco-otv' => Component::query()->where('device_id', $device->device_id)->where('type', 'Cisco-OTV')->exists(),
|
||||
'loadbalancer_rservers' => $device->rServers()->exists(),
|
||||
'ipsec_tunnels' => $device->ipsecTunnels()->exists(),
|
||||
'routes' => $device->routes()->exists(),
|
||||
'ospf' => $device->ospfInstances()->count(),
|
||||
'bgp' => $device->bgppeers()->count(),
|
||||
'vrf' => $device->vrfs()->count(),
|
||||
'cef' => $device->cefSwitching()->count(),
|
||||
'mpls' => $device->mplsLsps()->count(),
|
||||
'cisco-otv' => Component::query()->where('device_id', $device->device_id)->where('type', 'Cisco-OTV')->count(),
|
||||
'loadbalancer_rservers' => $device->rServers()->count(),
|
||||
'ipsec_tunnels' => $device->ipsecTunnels()->count(),
|
||||
'routes' => $device->routes()->count(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ class RoutingController implements DeviceTab
|
||||
public function data(Device $device): array
|
||||
{
|
||||
return [
|
||||
'routing_tabs' => array_keys(array_filter($this->tabs))
|
||||
'routing_tabs' => array_filter($this->tabs)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ $pagetitle[] = 'Routing';
|
||||
echo "<span style='font-weight: bold;'>Routing</span> » ";
|
||||
|
||||
unset($sep);
|
||||
foreach ($routing_tabs as $type) {
|
||||
foreach ($routing_tabs as $type => $type_count) {
|
||||
if (!$vars['proto']) {
|
||||
$vars['proto'] = $type;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ foreach ($routing_tabs as $type) {
|
||||
echo '<span class="pagemenu-selected">';
|
||||
}
|
||||
|
||||
echo generate_link($type_text[$type].' ('.$device_routing_count[$type].')', $link_array, array('proto' => $type));
|
||||
echo generate_link($type_text[$type].' ('.$type_count.')', $link_array, array('proto' => $type));
|
||||
if ($vars['proto'] == $type) {
|
||||
echo '</span>';
|
||||
}
|
||||
@@ -56,7 +56,7 @@ $protocol = basename($vars['proto']);
|
||||
if (is_file("includes/html/pages/device/routing/$protocol.inc.php")) {
|
||||
include "includes/html/pages/device/routing/$protocol.inc.php";
|
||||
} else {
|
||||
foreach ($routing_tabs as $type) {
|
||||
foreach ($routing_tabs as $type => $type_count) {
|
||||
if ($type != 'overview') {
|
||||
if (is_file("includes/html/pages/device/routing/overview/$type.inc.php")) {
|
||||
$g_i++;
|
||||
|
||||
Reference in New Issue
Block a user