From a118831b381ddaf21da7d1059d7ea5e8f80c0885 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 3 Jun 2022 16:48:55 +0200 Subject: [PATCH] Always load dashlets for all of the dashboard pane & activate only the given| the first one --- library/Icinga/Web/Dashboard/Dashboard.php | 6 ++---- library/Icinga/Web/Dashboard/DashboardHome.php | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/library/Icinga/Web/Dashboard/Dashboard.php b/library/Icinga/Web/Dashboard/Dashboard.php index ba9229f3a..95f47987e 100644 --- a/library/Icinga/Web/Dashboard/Dashboard.php +++ b/library/Icinga/Web/Dashboard/Dashboard.php @@ -136,10 +136,8 @@ class Dashboard extends BaseHtmlElement implements DashboardEntry $this->tabs->add( $pane->getName(), [ - 'title' => sprintf( - t('Show %s', 'dashboard.pane.tooltip'), - $pane->getTitle() - ), + 'active' => $pane->isActive(), + 'title' => sprintf(t('Show %s', 'dashboard.pane.tooltip'), $pane->getTitle()), 'label' => $pane->getTitle(), 'url' => clone($url), 'urlParams' => [$this->tabParam => $pane->getName()] diff --git a/library/Icinga/Web/Dashboard/DashboardHome.php b/library/Icinga/Web/Dashboard/DashboardHome.php index 8db816cc3..8c5b786d7 100644 --- a/library/Icinga/Web/Dashboard/DashboardHome.php +++ b/library/Icinga/Web/Dashboard/DashboardHome.php @@ -164,6 +164,7 @@ class DashboardHome extends BaseDashboard implements Sortable ->setPriority($pane->priority); $this->addEntry($newPane); + $newPane->loadDashboardEntries(); } if ($name !== null) { @@ -171,13 +172,11 @@ class DashboardHome extends BaseDashboard implements Sortable $pane = $this->getEntry($name); $this->activatePane($pane); - $pane->loadDashboardEntries(); } else { throw new HttpNotFoundException(t('Pane "%s" not found'), $name); } } elseif (($firstPane = $this->rewindEntries())) { $this->activatePane($firstPane); - $firstPane->loadDashboardEntries(); } return $this;