Dashboard: show description if any

This commit is contained in:
Thomas Gelf 2016-12-14 12:33:19 +01:00
parent fe489ce094
commit a6962dc326
5 changed files with 11 additions and 22 deletions

View File

@ -12,6 +12,13 @@
<?php endif ?> <?php endif ?>
<?php foreach ($this->dashboards as $dashboard): ?> <?php foreach ($this->dashboards as $dashboard): ?>
<h1><?= $this->escape($dashboard->getTitle()) ?></h1> <h1><?= $this->escape($dashboard->getTitle()) ?></h1>
<?php
$description = $dashboard->getDescription();
if ($description !== null): ?>
<p><?= nl2br($this->escape($description)) ?></p>
<?php endif ?>
<ul class="main-actions" data-base-target="_next"> <ul class="main-actions" data-base-target="_next">
<?php foreach ($dashboard->dashlets() as $dashlet): ?> <?php foreach ($dashboard->dashlets() as $dashlet): ?>
<li> <li>

View File

@ -53,7 +53,10 @@ abstract class Dashboard implements Countable
abstract public function getTitle(); abstract public function getTitle();
abstract public function getDescription(); public function getDescription()
{
return null;
}
public function count() public function count()
{ {

View File

@ -4,8 +4,6 @@ namespace Icinga\Module\Director\Dashboard;
class DataDashboard extends Dashboard class DataDashboard extends Dashboard
{ {
protected $name;
protected $dashletNames = array( protected $dashletNames = array(
'ImportSource', 'ImportSource',
'Sync', 'Sync',
@ -18,9 +16,4 @@ class DataDashboard extends Dashboard
{ {
return $this->translate('Do more with your data'); return $this->translate('Do more with your data');
} }
public function getDescription()
{
return $this->translate('...');
}
} }

View File

@ -4,8 +4,6 @@ namespace Icinga\Module\Director\Dashboard;
class DeploymentDashboard extends Dashboard class DeploymentDashboard extends Dashboard
{ {
protected $name;
protected $dashletNames = array( protected $dashletNames = array(
'Deployment', 'Deployment',
'ActivityLog', 'ActivityLog',
@ -18,9 +16,4 @@ class DeploymentDashboard extends Dashboard
{ {
return $this->translate('Deploy configuration to your Icinga nodes'); return $this->translate('Deploy configuration to your Icinga nodes');
} }
public function getDescription()
{
return $this->translate('...');
}
} }

View File

@ -4,8 +4,6 @@ namespace Icinga\Module\Director\Dashboard;
class ObjectsDashboard extends Dashboard class ObjectsDashboard extends Dashboard
{ {
protected $name;
protected $dashletNames = array( protected $dashletNames = array(
'HostObject', 'HostObject',
'ServiceObject', 'ServiceObject',
@ -19,9 +17,4 @@ class ObjectsDashboard extends Dashboard
{ {
return $this->translate('Define whatever you want to be monitored'); return $this->translate('Define whatever you want to be monitored');
} }
public function getDescription()
{
return $this->translate('...');
}
} }