From 85e1f0053e81bfcd7e19aebbec1ed1f3d5b951e0 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 28 Jul 2017 22:42:16 +0200 Subject: [PATCH] Dashlets: unify tabs, change apply position --- .../Dashlet/CommandTemplatesDashlet.php | 2 +- .../Dashlet/ExternalCheckCommandsDashlet.php | 2 +- .../Dashlet/NotificationTemplateDashlet.php | 2 +- .../Dashboard/Dashlet/ServiceSetsDashlet.php | 2 +- .../Dashlet/ServiceTemplatesDashlet.php | 2 +- .../Dashboard/NotificationsDashboard.php | 2 +- .../Director/Dashboard/ServicesDashboard.php | 2 +- library/Director/Web/Tabs/ObjectsTabs.php | 22 +++++++++---------- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/library/Director/Dashboard/Dashlet/CommandTemplatesDashlet.php b/library/Director/Dashboard/Dashlet/CommandTemplatesDashlet.php index 163b9f17..b09b29ee 100644 --- a/library/Director/Dashboard/Dashlet/CommandTemplatesDashlet.php +++ b/library/Director/Dashboard/Dashlet/CommandTemplatesDashlet.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Director\Dashboard\Dashlet; class CommandTemplatesDashlet extends CheckCommandsDashlet { - protected $icon = 'wrench'; + protected $icon = 'cubes'; public function getSummary() { diff --git a/library/Director/Dashboard/Dashlet/ExternalCheckCommandsDashlet.php b/library/Director/Dashboard/Dashlet/ExternalCheckCommandsDashlet.php index 2ac8c236..2711fb97 100644 --- a/library/Director/Dashboard/Dashlet/ExternalCheckCommandsDashlet.php +++ b/library/Director/Dashboard/Dashlet/ExternalCheckCommandsDashlet.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Director\Dashboard\Dashlet; class ExternalCheckCommandsDashlet extends CheckCommandsDashlet { - protected $icon = 'wrench'; + protected $icon = 'download'; public function getSummary() { diff --git a/library/Director/Dashboard/Dashlet/NotificationTemplateDashlet.php b/library/Director/Dashboard/Dashlet/NotificationTemplateDashlet.php index e382331b..a58b5d06 100644 --- a/library/Director/Dashboard/Dashlet/NotificationTemplateDashlet.php +++ b/library/Director/Dashboard/Dashlet/NotificationTemplateDashlet.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Director\Dashboard\Dashlet; class NotificationTemplateDashlet extends Dashlet { - protected $icon = 'paste'; + protected $icon = 'cubes'; protected $requiredStats = array('notification'); diff --git a/library/Director/Dashboard/Dashlet/ServiceSetsDashlet.php b/library/Director/Dashboard/Dashlet/ServiceSetsDashlet.php index 5e0fb20c..539d85cc 100644 --- a/library/Director/Dashboard/Dashlet/ServiceSetsDashlet.php +++ b/library/Director/Dashboard/Dashlet/ServiceSetsDashlet.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Director\Dashboard\Dashlet; class ServiceSetsDashlet extends Dashlet { - protected $icon = 'pin'; + protected $icon = 'services'; public function getTitle() { diff --git a/library/Director/Dashboard/Dashlet/ServiceTemplatesDashlet.php b/library/Director/Dashboard/Dashlet/ServiceTemplatesDashlet.php index 5f3b9586..62d1b410 100644 --- a/library/Director/Dashboard/Dashlet/ServiceTemplatesDashlet.php +++ b/library/Director/Dashboard/Dashlet/ServiceTemplatesDashlet.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Director\Dashboard\Dashlet; class ServiceTemplatesDashlet extends Dashlet { - protected $icon = 'services'; + protected $icon = 'cubes'; public function getTitle() { diff --git a/library/Director/Dashboard/NotificationsDashboard.php b/library/Director/Dashboard/NotificationsDashboard.php index 9e72fba6..b7d72f5b 100644 --- a/library/Director/Dashboard/NotificationsDashboard.php +++ b/library/Director/Dashboard/NotificationsDashboard.php @@ -5,8 +5,8 @@ namespace Icinga\Module\Director\Dashboard; class NotificationsDashboard extends Dashboard { protected $dashletNames = [ - 'NotificationTemplate', 'NotificationApply', + 'NotificationTemplate', ]; public function getTitle() diff --git a/library/Director/Dashboard/ServicesDashboard.php b/library/Director/Dashboard/ServicesDashboard.php index 5e9f96f5..65c8f0a5 100644 --- a/library/Director/Dashboard/ServicesDashboard.php +++ b/library/Director/Dashboard/ServicesDashboard.php @@ -6,9 +6,9 @@ class ServicesDashboard extends Dashboard { protected $dashletNames = array( 'SingleServices', + 'ServiceApplyRules', 'ServiceTemplates', 'ServiceGroups', - 'ServiceApplyRules', 'ServiceChoices', 'ServiceSets' ); diff --git a/library/Director/Web/Tabs/ObjectsTabs.php b/library/Director/Web/Tabs/ObjectsTabs.php index 043fa659..aa4766d4 100644 --- a/library/Director/Web/Tabs/ObjectsTabs.php +++ b/library/Director/Web/Tabs/ObjectsTabs.php @@ -23,6 +23,17 @@ class ObjectsTabs extends Tabs 'label' => $this->translate(ucfirst($type) . 's'), )); + if ($auth->hasPermission('director/admin') || ( + $object->getShortTableName() && $auth->hasPermission('director/notifications') + )) { + if ($object->supportsApplyRules()) { + $this->add('applyrules', array( + 'url' => sprintf('director/%ss/applyrules', $type), + 'label' => $this->translate('Apply') + )); + } + } + if ($auth->hasPermission('director/admin')) { if ($object->supportsImports()) { $this->add('templates', array( @@ -39,17 +50,6 @@ class ObjectsTabs extends Tabs } } - if ($auth->hasPermission('director/admin') || ( - $object->getShortTableName() && $auth->hasPermission('director/notifications') - )) { - if ($object->supportsApplyRules()) { - $this->add('applyrules', array( - 'url' => sprintf('director/%ss/applyrules', $type), - 'label' => $this->translate('Apply') - )); - } - } - if ($auth->hasPermission('director/admin')) { if ($object->supportsChoices()) { $this->add('choices', array(