mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix how we decide to show routing tab, and save some db queries
git-svn-id: http://www.observium.org/svn/observer/trunk@2296 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,20 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
unset($datas);
|
||||
|
||||
$device_routing_count['bgp'] = mysql_result(mysql_query("select count(*) from bgpPeers WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
if ($device_routing_count['bgp']) { $datas[] = 'bgp'; }
|
||||
|
||||
$device_routing_count['ospf'] = mysql_result(mysql_query("select count(*) from ospf_ports WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
if ($device_routing_count['ospf']) { $datas[] = 'ospf'; }
|
||||
|
||||
$device_routing_count['cef'] = mysql_result(mysql_query("select count(*) from cef_switching WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
if ($device_routing_count['cef']) { $datas[] = 'cef'; }
|
||||
|
||||
$device_routing_count['vrf'] = @mysql_result(mysql_query("select count(*) from vrfs WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
if($device_routing_count['vrf']) { $datas[] = 'vrf'; }
|
||||
|
||||
#$type_text['overview'] = "Overview";
|
||||
$type_text['bgp'] = "BGP";
|
||||
$type_text['cef'] = "CEF";
|
||||
@@ -26,7 +11,7 @@ print_optionbar_start();
|
||||
echo("<span style='font-weight: bold;'>Routing</span> » ");
|
||||
|
||||
unset($sep);
|
||||
foreach ($datas as $type)
|
||||
foreach ($routing_tabs as $type)
|
||||
{
|
||||
|
||||
if (!$_GET['opta']) { $_GET['opta'] = $type; }
|
||||
@@ -49,7 +34,7 @@ if (is_file("pages/device/routing/".mres($_GET['opta']).".inc.php"))
|
||||
{
|
||||
include("pages/device/routing/".mres($_GET['opta']).".inc.php");
|
||||
} else {
|
||||
foreach ($datas as $type)
|
||||
foreach ($routing_tabs as $type)
|
||||
{
|
||||
if ($type != "overview")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user