mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 07:14:35 +02:00
Hook\Grapher: use it in monitoring/show
This commit is contained in:
parent
2ab75e1433
commit
7f53ba11cf
@ -51,6 +51,8 @@ class Monitoring_ShowController extends Controller
|
|||||||
*/
|
*/
|
||||||
protected $backend;
|
protected $backend;
|
||||||
|
|
||||||
|
protected $grapher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the controller
|
* Initialize the controller
|
||||||
*/
|
*/
|
||||||
@ -67,6 +69,9 @@ class Monitoring_ShowController extends Controller
|
|||||||
if (Hook::has('ticket')) {
|
if (Hook::has('ticket')) {
|
||||||
$this->view->tickets = Hook::first('ticket');
|
$this->view->tickets = Hook::first('ticket');
|
||||||
}
|
}
|
||||||
|
if (Hook::has('grapher')) {
|
||||||
|
$this->grapher = Hook::first('grapher');
|
||||||
|
}
|
||||||
|
|
||||||
$this->createTabs();
|
$this->createTabs();
|
||||||
}
|
}
|
||||||
@ -76,11 +81,15 @@ class Monitoring_ShowController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function serviceAction()
|
public function serviceAction()
|
||||||
{
|
{
|
||||||
|
$o = $this->view->object;
|
||||||
$this->setAutorefreshInterval(10);
|
$this->setAutorefreshInterval(10);
|
||||||
$this->view->title = $this->view->object->service_description
|
$this->view->title = $o->service_description
|
||||||
. ' on ' . $this->view->object->host_name;
|
. ' on ' . $o->host_name;
|
||||||
$this->getTabs()->activate('service');
|
$this->getTabs()->activate('service');
|
||||||
$this->view->object->populate();
|
$o->populate();
|
||||||
|
if ($this->grapher && $this->grapher->hasGraph($o->host_name, $o->service_description)) {
|
||||||
|
$this->view->grapherHtml = $this->grapher->getPreviewImage($o->host_name, $o->service_description);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -88,10 +97,14 @@ class Monitoring_ShowController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function hostAction()
|
public function hostAction()
|
||||||
{
|
{
|
||||||
|
$o = $this->view->object;
|
||||||
$this->setAutorefreshInterval(10);
|
$this->setAutorefreshInterval(10);
|
||||||
$this->getTabs()->activate('host');
|
$this->getTabs()->activate('host');
|
||||||
$this->view->title = $this->view->object->host_name;
|
$this->view->title = $o->host_name;
|
||||||
$this->view->object->populate();
|
$o->populate();
|
||||||
|
if ($this->grapher && $this->grapher->hasGraph($o->host_name)) {
|
||||||
|
$this->view->grapherHtml = $this->grapher->getPreviewImage($o->host_name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function historyAction()
|
public function historyAction()
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
<?= $this->grapherHtml ?>
|
@ -4,6 +4,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<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') ?>
|
||||||
|
|
||||||
<table class="avp newsection">
|
<table class="avp newsection">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<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') ?>
|
||||||
|
|
||||||
<table class="avp newsection">
|
<table class="avp newsection">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user