InfrastructureDashboard: emphasize infra warning

fixes #2231
This commit is contained in:
Thomas Gelf 2020-11-28 11:39:45 +01:00
parent 7929d44a52
commit 184b39220b
4 changed files with 36 additions and 12 deletions

View File

@ -4,8 +4,8 @@
Working with Icinga 2 Agents can be quite tricky, as each Agent needs
its own Endpoint and Zone definition, correct parent, peering host and
log settings. There may always be reasons for a completely custom-made
configuration. However, I'd strongly suggest to give the Director-assisted
variant at least a try first. It might save you a lot of headaches.
configuration. However, I'd **strongly suggest** using the **Director-
assisted** variant. It will save you a lot of headaches.
Preparation

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -14,6 +14,7 @@ use Icinga\Module\Director\Restriction\HostgroupRestriction;
use Icinga\Module\Director\Dashboard\Dashlet\Dashlet;
use Icinga\Module\Director\Db;
use Icinga\Web\Widget\Tab;
use ipl\Html\ValidHtml;
use Zend_Db_Select as ZfSelect;
abstract class Dashboard extends HtmlDocument
@ -60,7 +61,9 @@ abstract class Dashboard extends HtmlDocument
*/
protected function addDescription($description)
{
if ($description !== null) {
if ($description instanceof ValidHtml) {
$this->add(Html::tag('p', $description));
} elseif ($description !== null) {
$this->add(Html::tag(
'p',
null,

View File

@ -2,7 +2,13 @@
namespace Icinga\Module\Director\Dashboard;
use gipfl\Web\Widget\Hint;
use Icinga\Application\Icinga;
use Icinga\Authentication\Auth;
use Icinga\Module\Director\Web\Tabs\InfraTabs;
use Icinga\Module\Director\Web\Widget\Documentation;
use ipl\Html\Html;
use ipl\Html\HtmlDocument;
class InfrastructureDashboard extends Dashboard
{
@ -20,16 +26,31 @@ class InfrastructureDashboard extends Dashboard
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.'
$documentation = new Documentation(Icinga::app(), Auth::getInstance());
$link = $documentation->getModuleLink(
$this->translate('documentation'),
'director',
'24-Working-with-agents',
$this->translate('Working with Agents and Config Zones')
);
return (new HtmlDocument())->add([
$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.'
),
Hint::warning($this->translate(
'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.'
)),
Html::sprintf(
$this->translate('Want to connect to your Icinga Agents? Have a look at our %s!'),
$link
)
]);
}
public function getTabs()