diff --git a/library/Icinga/Application/Modules/DashboardContainer.php b/library/Icinga/Application/Modules/DashboardContainer.php index 527c1351c..f3c8bc671 100644 --- a/library/Icinga/Application/Modules/DashboardContainer.php +++ b/library/Icinga/Application/Modules/DashboardContainer.php @@ -43,12 +43,16 @@ class DashboardContainer extends NavigationItemContainer * * @param string $name * @param string $url + * @param int $priority * * @return $this */ - public function add($name, $url) + public function add($name, $url, $priority = null) { - $this->dashlets[$name] = $url; + $this->dashlets[$name] = [ + 'url' => $url, + 'priority' => $priority + ]; return $this; } } diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index 735738089..e8350e156 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -315,10 +315,11 @@ class Module foreach ($panes as $pane) { /** @var DashboardContainer $pane */ $dashlets = []; - foreach ($pane->getDashlets() as $dashletName => $dashletUrl) { + foreach ($pane->getDashlets() as $dashletName => $dashletConfig) { $dashlets[$dashletName] = [ - 'label' => $this->translate($dashletName), - 'url' => $dashletUrl + 'label' => $this->translate($dashletName), + 'url' => $dashletConfig['url'], + 'priority' => $dashletConfig['priority'] ]; }