mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2026-02-03 20:40:02 -05:00
Show only applied groups in Icinga Host Form
Some checks are pending
L10n Update / update (push) Waiting to run
PHP Tests / Static analysis for php 7.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 7.3 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 7.4 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.0 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.1 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.3 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 7.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 7.3 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 7.4 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.0 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.1 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.3 on ubuntu-latest (push) Waiting to run
Some checks are pending
L10n Update / update (push) Waiting to run
PHP Tests / Static analysis for php 7.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 7.3 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 7.4 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.0 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.1 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.3 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 7.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 7.3 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 7.4 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.0 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.1 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.3 on ubuntu-latest (push) Waiting to run
This commit is contained in:
parent
4675acc039
commit
5f43bf70aa
2 changed files with 11 additions and 0 deletions
|
|
@ -236,6 +236,12 @@ class IcingaHostForm extends DirectorObjectForm
|
|||
));
|
||||
|
||||
$applied = $this->getAppliedGroups();
|
||||
if ($this->hasHostGroupRestriction()) {
|
||||
$applied = (new HostgroupRestriction($this->getDb(), $this->getAuth()))
|
||||
->filterRestrictedHostgroups($applied);
|
||||
}
|
||||
|
||||
|
||||
if (! empty($applied)) {
|
||||
$this->addElement('simpleNote', '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
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue