Dashlets: unify tabs, change apply position

This commit is contained in:
Thomas Gelf 2017-07-28 22:42:16 +02:00
parent 74a887f5af
commit 85e1f0053e
8 changed files with 18 additions and 18 deletions

View File

@ -4,7 +4,7 @@ namespace Icinga\Module\Director\Dashboard\Dashlet;
class CommandTemplatesDashlet extends CheckCommandsDashlet
{
protected $icon = 'wrench';
protected $icon = 'cubes';
public function getSummary()
{

View File

@ -4,7 +4,7 @@ namespace Icinga\Module\Director\Dashboard\Dashlet;
class ExternalCheckCommandsDashlet extends CheckCommandsDashlet
{
protected $icon = 'wrench';
protected $icon = 'download';
public function getSummary()
{

View File

@ -4,7 +4,7 @@ namespace Icinga\Module\Director\Dashboard\Dashlet;
class NotificationTemplateDashlet extends Dashlet
{
protected $icon = 'paste';
protected $icon = 'cubes';
protected $requiredStats = array('notification');

View File

@ -4,7 +4,7 @@ namespace Icinga\Module\Director\Dashboard\Dashlet;
class ServiceSetsDashlet extends Dashlet
{
protected $icon = 'pin';
protected $icon = 'services';
public function getTitle()
{

View File

@ -4,7 +4,7 @@ namespace Icinga\Module\Director\Dashboard\Dashlet;
class ServiceTemplatesDashlet extends Dashlet
{
protected $icon = 'services';
protected $icon = 'cubes';
public function getTitle()
{

View File

@ -5,8 +5,8 @@ namespace Icinga\Module\Director\Dashboard;
class NotificationsDashboard extends Dashboard
{
protected $dashletNames = [
'NotificationTemplate',
'NotificationApply',
'NotificationTemplate',
];
public function getTitle()

View File

@ -6,9 +6,9 @@ class ServicesDashboard extends Dashboard
{
protected $dashletNames = array(
'SingleServices',
'ServiceApplyRules',
'ServiceTemplates',
'ServiceGroups',
'ServiceApplyRules',
'ServiceChoices',
'ServiceSets'
);

View File

@ -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(