DashboardList: Try to load dashlets when the current pane is empty

The controller only loads dashboards/dashlets either of the given name
or of the first home/pane that can be determined, so we need to load dashlets
for panes that aren't active when creating the list. Otherwise, we will end
up with empty dashboard panes.
This commit is contained in:
Yonas Habteab 2022-06-13 09:24:25 +02:00
parent a6483e6e28
commit 92226d4f08

View File

@ -23,6 +23,9 @@ class DashboardList extends ItemListControl
public function __construct(Pane $pane)
{
$this->pane = $pane;
if (! $this->pane->hasEntries()) {
$this->pane->loadDashboardEntries();
}
$this->getAttributes()
->registerAttributeCallback('data-icinga-pane', function () {