Files
librenms-librenms/includes/html/pages/device/edit.inc.php
Tony Murray 61316ce2cc PHP 8 fixes (#12528)
* port related errors

* more fixes

* fix storage count

* add tests for php8

* style

* only need not empty

* aix fixes....

* storage WIP

* fix aix discovering hrstorage
fix db test adding .gitkeep
fix os modules when discovery only

* fix aos processors wrong oid

* fix mempool number casting

* fix aos7 cpu

* use + 0 cast instead of floatval()

* more verbose error on invalid json

* remove invalid data in json

* actually fix the json

* correct json error fix

* cast_number() function
fix aruba-instant and aos6 bugs exposed by new function, probably more...

* fix a-f
fix inadequate sort for component data

* fix global port poll time

* fix mempools precent 0, route count, ntp const

* fix schleifenbauer liberal current usage

* further number casting refinement

* vrp

* fix tests

* fix arbos

* warn cleanups adjust to :: change

* fix ciena-sds

* fix drac

* fix dell-rpdu anddlink

* fix and improve arubaos
better error when getting an array in Processor

* fix atenpdu, add missing arubaos files

* aruba-instant to yaml
apparently I didn't need to do this, the diff just looks really odd
It did add ranged sub-index replacements

* docker app, was completely wrong... fixed

* fix sentry4 divide by 0...

* fixed root issue, remove check

* nicer cidr in ipv6 code

* remove bogus enuxus battery bank skip_values

* Fix InfluxDB tests

* remove extra import

* fix other style issues.

* influx "style" fixes
2021-03-12 18:10:14 -06:00

89 lines
2.4 KiB
PHP

<?php
$no_refresh = true;
$link_array = ['page' => 'device',
'device' => $device['device_id'],
'tab' => 'edit', ];
if (! Auth::user()->hasGlobalAdmin()) {
print_error('Insufficient Privileges');
} else {
$panes['device'] = 'Device Settings';
$panes['snmp'] = 'SNMP';
if (! $device['snmp_disable']) {
$panes['ports'] = 'Port Settings';
}
if (dbFetchCell('SELECT COUNT(*) FROM `bgpPeers` WHERE `device_id` = ? LIMIT 1', [$device['device_id']]) > 0) {
$panes['routing'] = 'Routing';
}
if (count(\LibreNMS\Config::get("os.{$device['os']}.icons", []))) {
$panes['icon'] = 'Icon';
}
if (! $device['snmp_disable']) {
$panes['apps'] = 'Applications';
}
$panes['alert-rules'] = 'Alert Rules';
if (! $device['snmp_disable']) {
$panes['modules'] = 'Modules';
}
if (\LibreNMS\Config::get('show_services')) {
$panes['services'] = 'Services';
}
$panes['ipmi'] = 'IPMI';
if (dbFetchCell("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = ? AND `sensor_deleted`='0' LIMIT 1", [$device['device_id']]) > 0) {
$panes['health'] = 'Health';
}
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';
}
if (! $device['snmp_disable']) {
$panes['storage'] = 'Storage';
$panes['processors'] = 'Processors';
$panes['mempools'] = 'Memory';
}
$panes['misc'] = 'Misc';
$panes['component'] = 'Components';
$panes['customoid'] = 'Custom OID';
print_optionbar_start();
unset($sep);
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 = ' | ';
}
print_optionbar_end();
$section = basename($vars['section']);
if (is_file("includes/html/pages/device/edit/$section.inc.php")) {
require "includes/html/pages/device/edit/$section.inc.php";
}
}
$pagetitle[] = 'Settings';