From d3e55ed5c91743f8fa5324462e15849a65fa4048 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 16 Jan 2017 08:50:18 +0100 Subject: [PATCH] Dashboards: add Infrastructure dashboard fixes #14017 --- .../Dashlet/InfrastructureDashlet.php | 30 +++++++++++++++++ .../Dashboard/Dashlet/KickstartDashlet.php | 30 +++++++++++++++++ library/Director/Dashboard/DataDashboard.php | 1 - .../Dashboard/DeploymentDashboard.php | 5 ++- .../Dashboard/InfrastructureDashboard.php | 32 +++++++++++++++++++ .../Director/Dashboard/ObjectsDashboard.php | 1 - 6 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 library/Director/Dashboard/Dashlet/InfrastructureDashlet.php create mode 100644 library/Director/Dashboard/Dashlet/KickstartDashlet.php create mode 100644 library/Director/Dashboard/InfrastructureDashboard.php diff --git a/library/Director/Dashboard/Dashlet/InfrastructureDashlet.php b/library/Director/Dashboard/Dashlet/InfrastructureDashlet.php new file mode 100644 index 00000000..e2e074c6 --- /dev/null +++ b/library/Director/Dashboard/Dashlet/InfrastructureDashlet.php @@ -0,0 +1,30 @@ +translate('Icinga Infrastructure'); + } + + public function getEscapedSummary() + { + return $this->translate( + 'Manage your Icinga 2 infrastructure: Masters, Zones, Satellites and more' + ); + } + + public function getUrl() + { + return 'director/dashboard?name=infrastructure'; + } + + public function listRequiredPermissions() + { + return array('director/admin'); + } +} diff --git a/library/Director/Dashboard/Dashlet/KickstartDashlet.php b/library/Director/Dashboard/Dashlet/KickstartDashlet.php new file mode 100644 index 00000000..45a1f854 --- /dev/null +++ b/library/Director/Dashboard/Dashlet/KickstartDashlet.php @@ -0,0 +1,30 @@ +translate('Kickstart Helper'); + } + + public function getEscapedSummary() + { + return $this->translate( + 'This syncronizes Icinga Director to your Icinga 2 infrastructure' + ); + } + + public function getUrl() + { + return 'director/kickstart'; + } + + public function listRequiredPermissions() + { + return array('director/admin'); + } +} diff --git a/library/Director/Dashboard/DataDashboard.php b/library/Director/Dashboard/DataDashboard.php index f509490c..d7b9a7d6 100644 --- a/library/Director/Dashboard/DataDashboard.php +++ b/library/Director/Dashboard/DataDashboard.php @@ -7,7 +7,6 @@ class DataDashboard extends Dashboard protected $dashletNames = array( 'ImportSource', 'Sync', - 'Job', 'Datafield', 'Datalist', ); diff --git a/library/Director/Dashboard/DeploymentDashboard.php b/library/Director/Dashboard/DeploymentDashboard.php index 22fc00b4..3ad7516f 100644 --- a/library/Director/Dashboard/DeploymentDashboard.php +++ b/library/Director/Dashboard/DeploymentDashboard.php @@ -7,9 +7,8 @@ class DeploymentDashboard extends Dashboard protected $dashletNames = array( 'Deployment', 'ActivityLog', - 'ApiUserObject', - 'EndpointObject', - 'ZoneObject', + 'Job', + 'Infrastructure', ); public function getTitle() diff --git a/library/Director/Dashboard/InfrastructureDashboard.php b/library/Director/Dashboard/InfrastructureDashboard.php new file mode 100644 index 00000000..e9876e55 --- /dev/null +++ b/library/Director/Dashboard/InfrastructureDashboard.php @@ -0,0 +1,32 @@ +translate('Manage your Icinga Infrastructure'); + } + + public function getDescription() + { + return $this->translate( + 'This is where you manage your Icinga 2 infrastructure. When adding' + . ' a new Icinga Master or Satellite please re-run the Kickstart' + . ' Helper once.' + . "\n\n" + . 'When you feel the desire to manually create Zone or Endpoint' + . ' objects please rethink this twice. Doing so is mostly the wrong' + . ' way, might lead to a dead end, requiring quite some effort to' + . ' clean up the whole mess afterwards.' + ); + } +} diff --git a/library/Director/Dashboard/ObjectsDashboard.php b/library/Director/Dashboard/ObjectsDashboard.php index c8fcdaa6..44783947 100644 --- a/library/Director/Dashboard/ObjectsDashboard.php +++ b/library/Director/Dashboard/ObjectsDashboard.php @@ -9,7 +9,6 @@ class ObjectsDashboard extends Dashboard 'ServiceObject', 'CommandObject', 'Notifications', - 'TimeperiodObject', ); public function getTitle()