parent
59cadde485
commit
0a9aa20dfa
|
@ -1,6 +1,7 @@
|
||||||
<div class="content" data-base-target="_next">
|
<div class="content" data-base-target="_next">
|
||||||
<?= $this->render('show/components/output.phtml') ?>
|
<?= $this->render('show/components/output.phtml') ?>
|
||||||
<?= $this->render('show/components/grapher.phtml') ?>
|
<?= $this->render('show/components/grapher.phtml') ?>
|
||||||
|
<?= $this->render('show/components/extensions.phtml') ?>
|
||||||
|
|
||||||
<h2><?= $this->translate('Problem handling') ?></h2>
|
<h2><?= $this->translate('Problem handling') ?></h2>
|
||||||
<table class="name-value-table">
|
<table class="name-value-table">
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?php
|
||||||
|
foreach ($extensionsHtml as $extensionHtml) {
|
||||||
|
echo $extensionHtml;
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
<?php
|
||||||
|
/* Icinga Web 2 | (c) 2017 Icinga Development Team | GPLv2+ */
|
||||||
|
|
||||||
|
namespace Icinga\Module\Monitoring\Hook;
|
||||||
|
|
||||||
|
use Icinga\Module\Monitoring\Object\MonitoredObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class for hooks extending the detail view of monitored objects
|
||||||
|
*
|
||||||
|
* Extend this class if you want to extend the detail view of monitored objects with custom HTML.
|
||||||
|
*/
|
||||||
|
abstract class DetailviewExtensionHook
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a new hook
|
||||||
|
*
|
||||||
|
* @see init() For hook initialization.
|
||||||
|
*/
|
||||||
|
final public function __construct()
|
||||||
|
{
|
||||||
|
$this->init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overwrite this function for hook initialization, e.g. loading the hook's config
|
||||||
|
*/
|
||||||
|
protected function init()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shall return valid HTML to include in the detail view
|
||||||
|
*
|
||||||
|
* @param MonitoredObject $object The object to generate HTML for
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
abstract public function getHtmlForObject(MonitoredObject $object);
|
||||||
|
}
|
|
@ -10,6 +10,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\ObjectsCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\ObjectsCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\RemoveAcknowledgementCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\RemoveAcknowledgementCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\ToggleObjectFeaturesCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\ToggleObjectFeaturesCommandForm;
|
||||||
|
use Icinga\Module\Monitoring\Hook\DetailviewExtensionHook;
|
||||||
use Icinga\Web\Hook;
|
use Icinga\Web\Hook;
|
||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
||||||
|
@ -96,6 +97,12 @@ abstract class MonitoredObjectController extends Controller
|
||||||
}
|
}
|
||||||
$this->view->showInstance = $this->backend->select()->from('instance')->count() > 1;
|
$this->view->showInstance = $this->backend->select()->from('instance')->count() > 1;
|
||||||
$this->view->object = $this->object;
|
$this->view->object = $this->object;
|
||||||
|
|
||||||
|
$this->view->extensionsHtml = array();
|
||||||
|
foreach (Hook::all('Monitoring\DetailviewExtension') as $hook) {
|
||||||
|
/** @var DetailviewExtensionHook $hook */
|
||||||
|
$this->view->extensionsHtml[] = $hook->getHtmlForObject($this->object);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue