mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-17 18:02:26 -05:00
parent
56e37d2876
commit
3985f67fe7
6 changed files with 82 additions and 2 deletions
24
application/controllers/HostController.php
Normal file
24
application/controllers/HostController.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Module\Businessprocess\Controllers;
|
||||
|
||||
use Icinga\Module\Monitoring\Controller;
|
||||
use Icinga\Web\Url;
|
||||
|
||||
class HostController extends Controller
|
||||
{
|
||||
public function showAction()
|
||||
{
|
||||
$host = $this->params->getRequired('host');
|
||||
|
||||
$query = $this->backend->select()
|
||||
->from('hoststatus', array('host_name'))
|
||||
->where('host_name', $host);
|
||||
|
||||
if ($this->applyRestriction('monitoring/filter/objects', $query)->fetchRow() !== false) {
|
||||
$this->redirectNow(Url::fromPath('monitoring/host/show')->setParams($this->params));
|
||||
}
|
||||
|
||||
$this->view->host = $host;
|
||||
}
|
||||
}
|
||||
27
application/controllers/ServiceController.php
Normal file
27
application/controllers/ServiceController.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Module\Businessprocess\Controllers;
|
||||
|
||||
use Icinga\Module\Monitoring\Controller;
|
||||
use Icinga\Web\Url;
|
||||
|
||||
class ServiceController extends Controller
|
||||
{
|
||||
public function showAction()
|
||||
{
|
||||
$host = $this->params->getRequired('host');
|
||||
$service = $this->params->getRequired('service');
|
||||
|
||||
$query = $this->backend->select()
|
||||
->from('servicestatus', array('service_description'))
|
||||
->where('host_name', $host)
|
||||
->where('service_description', $service);
|
||||
|
||||
if ($this->applyRestriction('monitoring/filter/objects', $query)->fetchRow() !== false) {
|
||||
$this->redirectNow(Url::fromPath('monitoring/service/show')->setParams($this->params));
|
||||
}
|
||||
|
||||
$this->view->host = $host;
|
||||
$this->view->service = $service;
|
||||
}
|
||||
}
|
||||
12
application/views/scripts/host/show.phtml
Normal file
12
application/views/scripts/host/show.phtml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
/** @var \Icinga\Web\View $this */
|
||||
/** @var \Icinga\Web\Widget\Tabs $tabs */
|
||||
/** @var string $host */
|
||||
?>
|
||||
<div class="controls">
|
||||
<?= $tabs->showOnlyCloseButton() ?>
|
||||
</div>
|
||||
<div class="content">
|
||||
<h1><?= $this->escape($this->translate('Access denied')) ?></h1>
|
||||
<p><?php printf($this->escape($this->translate('Access to host "%s" denied')), $host) ?></p>
|
||||
</div>
|
||||
17
application/views/scripts/service/show.phtml
Normal file
17
application/views/scripts/service/show.phtml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
/** @var \Icinga\Web\View $this */
|
||||
/** @var \Icinga\Web\Widget\Tabs $tabs */
|
||||
/** @var string $host */
|
||||
/** @var string $service */
|
||||
?>
|
||||
<div class="controls">
|
||||
<?= $tabs->showOnlyCloseButton() ?>
|
||||
</div>
|
||||
<div class="content">
|
||||
<h1><?= $this->escape($this->translate('Access denied')) ?></h1>
|
||||
<p><?php printf(
|
||||
$this->escape($this->translate('Access to service "%s" of host "%s" denied')),
|
||||
$service,
|
||||
$host
|
||||
) ?></p>
|
||||
</div>
|
||||
|
|
@ -64,7 +64,7 @@ class HostNode extends MonitoredNode
|
|||
$params['backend'] = $this->bp->getBackendName();
|
||||
}
|
||||
|
||||
return Url::fromPath('monitoring/host/show', $params);
|
||||
return Url::fromPath('businessprocess/host/show', $params);
|
||||
}
|
||||
|
||||
public function getLink()
|
||||
|
|
|
|||
|
|
@ -51,6 +51,6 @@ class ServiceNode extends MonitoredNode
|
|||
$params['backend'] = $this->bp->getBackendName();
|
||||
}
|
||||
|
||||
return Url::fromPath('monitoring/service/show', $params);
|
||||
return Url::fromPath('businessprocess/service/show', $params);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue