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