Dashboards: restructured

fixes #1014
This commit is contained in:
Thomas Gelf 2017-07-14 11:02:44 +02:00
parent 05d8e5bb00
commit 6874a5f90c
11 changed files with 146 additions and 10 deletions

View File

@ -17,8 +17,9 @@ class DashboardController extends ActionController
$this->setAutorefreshInterval(10);
}
$this->setTitle($this->translate('Icinga Director'));
$names = $this->params->getValues('name', array('Objects', 'Deployment', 'Data'));
$mainDashlets = ['Objects', 'Alerts', 'Automation', 'Deployment', 'Data'];
$this->setTitle($this->translate('Icinga Director - Main Dashboard'));
$names = $this->params->getValues('name', $mainDashlets);
if (count($names) === 1) {
// TODO: Find a better way for this
$this->addSingleTab($this->translate(ucfirst($names[0])));

View File

@ -0,0 +1,17 @@
<?php
namespace Icinga\Module\Director\Dashboard;
class AlertsDashboard extends Dashboard
{
protected $dashletNames = array(
'Notifications',
'Users',
'Timeperiods',
);
public function getTitle()
{
return $this->translate('Get alerts when something goes wrong');
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace Icinga\Module\Director\Dashboard;
class AutomationDashboard extends Dashboard
{
protected $dashletNames = array(
'ImportSource',
'Sync',
'Job'
);
public function getTitle()
{
return $this->translate('Automate all tasks');
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace Icinga\Module\Director\Dashboard\Dashlet;
class TimeperiodsDashlet extends Dashlet
{
protected $icon = 'calendar';
protected $requiredStats = array('timeperiod');
public function getTitle()
{
return $this->translate('Timeperiods');
}
public function getUrl()
{
return 'director/dashboard?name=timePeriods';
}
public function listRequiredPermissions()
{
return array('director/admin');
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace Icinga\Module\Director\Dashboard\Dashlet;
class UsersDashlet extends Dashlet
{
protected $icon = 'users';
protected $requiredStats = array('user', 'usergroup');
public function getTitle()
{
return $this->translate('Users / Contacts');
}
public function listRequiredPermissions()
{
return array('director/users');
}
public function getUrl()
{
return 'director/dashboard?name=users';
}
}

View File

@ -5,14 +5,13 @@ namespace Icinga\Module\Director\Dashboard;
class DataDashboard extends Dashboard
{
protected $dashletNames = array(
'ImportSource',
'Sync',
'Datafield',
'Datalist',
// 'CustomVars'
);
public function getTitle()
{
return $this->translate('Do more with your data');
return $this->translate('Do more with custom data');
}
}

View File

@ -5,9 +5,8 @@ namespace Icinga\Module\Director\Dashboard;
class DeploymentDashboard extends Dashboard
{
protected $dashletNames = array(
'Deployment',
'ActivityLog',
'Job',
'Deployment',
'Infrastructure',
);

View File

@ -7,8 +7,6 @@ class NotificationsDashboard extends Dashboard
protected $dashletNames = [
'NotificationTemplate',
'NotificationApply',
'UserObject',
'TimeperiodObject'
];
public function getTitle()

View File

@ -8,7 +8,7 @@ class ObjectsDashboard extends Dashboard
'HostObject',
'ServiceObject',
'CommandObject',
'Notifications',
// 'Notifications',
);
public function getTitle()

View File

@ -0,0 +1,26 @@
<?php
namespace Icinga\Module\Director\Dashboard;
class TimePeriodsDashboard extends Dashboard
{
protected $dashletNames = [
'TimeperiodObject'
// 'TimeperiodTemplate',
];
public function getTitle()
{
return $this->translate('Define custom Time Periods');
}
public function getDescription()
{
return $this->translate(
'Want to define to execute specific checks only withing specific'
. ' time periods? Get mobile notifications only out of office hours,'
. ' but mail notifications all around the clock? Time Periods allow'
. ' you to tackle those and similar requirements.'
);
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace Icinga\Module\Director\Dashboard;
class UsersDashboard extends Dashboard
{
protected $dashletNames = [
'UserObject',
// 'UserTemplate',
// 'UserGroup',
];
public function getTitle()
{
return $this->translate('Schedule your notifications');
}
public function getDescription()
{
return $this->translate(
'This is where you manage your Icinga 2 User (Contact) objects. Try'
. ' to keep your User objects simply by movin complexity to your'
. ' templates. Bundle your users in groups and build Notifications'
. ' based on them. Running MS Active Directory or another central'
. ' User inventory? Stay away from fiddling with manual config, try'
. ' to automate all the things with Imports and related Sync Rules!'
);
}
}