mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 18:59:05 +02:00
Show only applied groups in Icinga Host Form
This commit is contained in:
parent
6749b4fb08
commit
fda1e79c80
@ -236,6 +236,12 @@ class IcingaHostForm extends DirectorObjectForm
|
|||||||
));
|
));
|
||||||
|
|
||||||
$applied = $this->getAppliedGroups();
|
$applied = $this->getAppliedGroups();
|
||||||
|
if ($this->hasHostGroupRestriction()) {
|
||||||
|
$applied = (new HostgroupRestriction($this->getDb(), $this->getAuth()))
|
||||||
|
->filterRestrictedHostgroups($applied);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (! empty($applied)) {
|
if (! empty($applied)) {
|
||||||
$this->addElement('simpleNote', 'applied_groups', [
|
$this->addElement('simpleNote', 'applied_groups', [
|
||||||
'label' => $this->translate('Applied groups'),
|
'label' => $this->translate('Applied groups'),
|
||||||
|
@ -121,6 +121,11 @@ class HostgroupRestriction extends ObjectRestriction
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function filterRestrictedHostgroups(array $groups)
|
||||||
|
{
|
||||||
|
return array_intersect($groups, $this->listRestrictedHostgroups());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply the restriction to the given Hosts Query
|
* Apply the restriction to the given Hosts Query
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user