Files

89 lines
2.3 KiB
PHP
Raw Permalink Normal View History

2007-04-04 10:15:07 +00:00
<?php
2016-08-18 20:28:22 -05:00
$no_refresh = true;
2020-09-21 15:40:17 +02:00
$link_array = ['page' => 'device',
2015-07-13 20:10:26 +02:00
'device' => $device['device_id'],
2020-09-21 15:40:17 +02:00
'tab' => 'edit', ];
2011-09-18 18:38:42 +00:00
2020-09-21 15:40:17 +02:00
if (! Auth::user()->hasGlobalAdmin()) {
2020-09-21 15:59:34 +02:00
print_error('Insufficient Privileges');
2016-08-18 20:28:22 -05:00
} else {
2020-09-21 15:40:17 +02:00
$panes['device'] = 'Device Settings';
$panes['snmp'] = 'SNMP';
if (! $device['snmp_disable']) {
$panes['ports'] = 'Port Settings';
}
2016-08-18 20:28:22 -05:00
2020-09-21 15:59:34 +02:00
if (dbFetchCell('SELECT COUNT(*) FROM `bgpPeers` WHERE `device_id` = ? LIMIT 1', [$device['device_id']]) > 0) {
2018-09-11 05:54:46 +02:00
$panes['routing'] = 'Routing';
}
2019-06-23 00:29:12 -05:00
if (count(\LibreNMS\Config::get("os.{$device['os']}.icons"))) {
2020-09-21 15:40:17 +02:00
$panes['icon'] = 'Icon';
2016-08-18 20:28:22 -05:00
}
2014-06-14 23:05:31 +01:00
2020-09-21 15:40:17 +02:00
if (! $device['snmp_disable']) {
$panes['apps'] = 'Applications';
}
2016-08-18 20:28:22 -05:00
$panes['alert-rules'] = 'Alert Rules';
2020-09-21 15:40:17 +02:00
if (! $device['snmp_disable']) {
$panes['modules'] = 'Modules';
}
2015-08-03 10:46:40 +00:00
2019-06-23 00:29:12 -05:00
if (\LibreNMS\Config::get('show_services')) {
2016-08-18 20:28:22 -05:00
$panes['services'] = 'Services';
}
2015-08-15 16:01:43 +10:00
2020-09-21 15:40:17 +02:00
$panes['ipmi'] = 'IPMI';
2020-09-21 15:40:17 +02:00
if (dbFetchCell("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = ? AND `sensor_deleted`='0' LIMIT 1", [$device['device_id']]) > 0) {
2016-08-18 20:28:22 -05:00
$panes['health'] = 'Health';
2015-07-13 20:10:26 +02:00
}
2011-09-18 18:38:42 +00:00
2020-09-21 15:40:17 +02:00
if (dbFetchCell("SELECT COUNT(*) FROM `wireless_sensors` WHERE `device_id` = ? AND `sensor_deleted`='0' LIMIT 1", [$device['device_id']]) > 0) {
2017-05-01 23:49:11 -05:00
$panes['wireless-sensors'] = 'Wireless Sensors';
}
2020-09-21 15:40:17 +02:00
if (! $device['snmp_disable']) {
$panes['storage'] = 'Storage';
$panes['processors'] = 'Processors';
$panes['mempools'] = 'Memory';
}
2020-09-21 15:40:17 +02:00
$panes['misc'] = 'Misc';
2016-08-18 20:28:22 -05:00
$panes['component'] = 'Components';
$panes['customoid'] = 'Custom OID';
2016-08-18 20:28:22 -05:00
print_optionbar_start();
unset($sep);
foreach ($panes as $type => $text) {
2020-09-21 15:40:17 +02:00
if (! isset($vars['section'])) {
2016-08-18 20:28:22 -05:00
$vars['section'] = $type;
}
2020-09-21 15:40:17 +02:00
echo $sep;
2016-08-18 20:28:22 -05:00
if ($vars['section'] == $type) {
2020-09-21 15:40:17 +02:00
echo "<span class='pagemenu-selected'>";
2016-08-18 20:28:22 -05:00
} else {
}
2020-09-21 15:40:17 +02:00
echo generate_link($text, $link_array, ['section'=>$type]);
2016-08-18 20:28:22 -05:00
if ($vars['section'] == $type) {
2020-09-21 15:59:34 +02:00
echo '</span>';
2016-08-18 20:28:22 -05:00
}
2020-09-21 15:59:34 +02:00
$sep = ' | ';
2015-07-13 20:10:26 +02:00
}
2016-08-18 20:28:22 -05:00
print_optionbar_end();
2007-04-04 10:15:07 +00:00
2019-04-11 23:26:42 -05:00
$section = basename($vars['section']);
if (is_file("includes/html/pages/device/edit/$section.inc.php")) {
require "includes/html/pages/device/edit/$section.inc.php";
2016-08-18 20:28:22 -05:00
}
2007-04-04 10:15:07 +00:00
}
2020-09-21 15:59:34 +02:00
$pagetitle[] = 'Settings';