mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Updated device cache support (#10795)
* Device Cache also some additional device related models * attribs from cache * replace common attribute functions * remove legacy cache usage tidy up some collection manipulation remove some unused or single use functions * cleanup some items * always return a device, to prevent bugs * clear device cache when testing after each test * fix double assignment * Clean up function to take advantage of null object
This commit is contained in:
committed by
Neil Lathwood
parent
d1c73b14f3
commit
dec9a498ee
@@ -17,6 +17,7 @@ if (device_permitted($vars['device']) || $permitted_by_port) {
|
||||
}
|
||||
$select = array($tab => 'class="active"');
|
||||
|
||||
DeviceCache::setPrimary($vars['device']);
|
||||
$device = device_by_id_cache($vars['device']);
|
||||
$attribs = get_dev_attribs($device['device_id']);
|
||||
$device['attribs'] = $attribs;
|
||||
@@ -381,7 +382,7 @@ if (device_permitted($vars['device']) || $permitted_by_port) {
|
||||
}
|
||||
|
||||
if ($device_config_file) {
|
||||
if (!get_dev_attrib($device, 'override_Oxidized_disable', 'true')) {
|
||||
if (!get_dev_attrib($device, 'override_Oxidized_disable') === 'true') {
|
||||
echo '<li class="'.$select['showconfig'].'">
|
||||
<a href="'.generate_device_url($device, array('tab' => 'showconfig')).'">
|
||||
<i class="fa fa-align-justify fa-lg icon-theme" aria-hidden="true"></i> Config
|
||||
|
||||
@@ -28,7 +28,7 @@ foreach ($applications as $app) {
|
||||
if (isset($enabled_apps[$app])) {
|
||||
$modifiers = ' checked';
|
||||
if ($enabled_apps[$app]
|
||||
&& is_dev_attrib_enabled($device, "poll_applications", Config::getOsSetting($device['os'], "poller_modules.applications"))
|
||||
&& (get_dev_attrib($device, 'poll_applications') || Config::getOsSetting($device['os'], "poller_modules.applications"))
|
||||
) {
|
||||
$app_text .= '<span class="text-success"> (Discovered)</span>';
|
||||
$modifiers .= ' disabled';
|
||||
|
||||
Reference in New Issue
Block a user