mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-05-28 04:34:08 -04:00
remove unneeded fetchHostVars and fetchCustomVars calls in detail view extension
This commit is contained in:
parent
7c45a322ce
commit
fe743086bc
2 changed files with 4 additions and 5 deletions
|
|
@ -57,7 +57,6 @@ class ServiceDetailExtension extends ServiceDetailExtensionHook
|
|||
'tree_var',
|
||||
'icingaweb_businessprocess_as_tree'
|
||||
);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
// Ignore and don't display anything
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,9 +76,9 @@ class DetailviewExtension extends DetailviewExtensionHook
|
|||
return '';
|
||||
}
|
||||
|
||||
$customvars = array_merge($object->fetchHostVariables()->hostVariables, $object->fetchCustomvars()->customvars); #Must grab customvars with this method, object access will not work with coalesce operator
|
||||
|
||||
$bpName = $customvars[$this->configVar] ?? null;
|
||||
# Grab custom vars first, merge service over host vars
|
||||
$customvars = array_merge($object->hostVariables, $object->customvars);
|
||||
$bpName = $customvars[$this->configVar] ?? null;
|
||||
if (! $bpName) {
|
||||
$bpName = key($this->storage->listProcessNames());
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ class DetailviewExtension extends DetailviewExtensionHook
|
|||
|
||||
MonitoringState::apply($bp);
|
||||
|
||||
if (filter_var( $customvars[$this->treeVar] ?? false, FILTER_VALIDATE_BOOLEAN)) {
|
||||
if (filter_var($customvars[$this->treeVar] ?? false, FILTER_VALIDATE_BOOLEAN)) {
|
||||
$renderer = new TreeRenderer($bp, $node);
|
||||
$tag = 'ul';
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue