DashboardController: allow to load other...

...dashboards than the default one
This commit is contained in:
Thomas Gelf 2016-12-14 14:58:51 +01:00
parent 30c2dfad75
commit 7f5ae5e321
1 changed files with 8 additions and 2 deletions

View File

@ -20,9 +20,15 @@ class DashboardController extends ActionController
}
$this->view->title = $this->translate('Icinga Director');
$this->singleTab($this->translate('Overview'));
$names = $this->params->getValues('name', array('Objects', 'Deployment', 'Data'));
if (count($names) === 1) {
// TODO: Find a better way for this
$this->singleTab($this->translate(ucfirst($names[0])));
} else {
$this->singleTab($this->translate('Overview'));
}
$dashboards = array();
foreach (array('Objects', 'Deployment', 'Data') as $name) {
foreach ($names as $name) {
$dashboard = Dashboard::loadByName($name, $this->db(), $this->view);
if ($dashboard->isAvailable()) {
$dashboards[$name] = $dashboard;