mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
Dashboard: show Health to admins only
This commit is contained in:
parent
c93657c42e
commit
8cec78a7c3
@ -45,15 +45,18 @@ class DashboardController extends ActionController
|
|||||||
$this->tabs()->add('main', [
|
$this->tabs()->add('main', [
|
||||||
'label' => $this->translate('Overview'),
|
'label' => $this->translate('Overview'),
|
||||||
'url' => 'director'
|
'url' => 'director'
|
||||||
])->add('health', [
|
|
||||||
'label' => $this->translate('Health'),
|
|
||||||
'url' => 'director/health'
|
|
||||||
])->activate('main');
|
])->activate('main');
|
||||||
$state = $this->getHealthState();
|
if ($this->hasPermission('director/admin')) {
|
||||||
if ($state->isProblem()) {
|
$this->tabs()->add('health', [
|
||||||
$this->tabs()->get('health')->setTagParams([
|
'label' => $this->translate('Health'),
|
||||||
'class' => 'state-' . strtolower($state->getName())
|
'url' => 'director/health'
|
||||||
]);
|
]);
|
||||||
|
$state = $this->getHealthState();
|
||||||
|
if ($state->isProblem()) {
|
||||||
|
$this->tabs()->get('health')->setTagParams([
|
||||||
|
'class' => 'state-' . strtolower($state->getName())
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user