mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
parent
860cc59155
commit
ef16ba5f48
@ -10,7 +10,8 @@ use Icinga\Module\Monitoring\Forms\Command\Object\ProcessCheckResultCommandForm;
|
|||||||
use Icinga\Module\Monitoring\Forms\Command\Object\RemoveAcknowledgementCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\RemoveAcknowledgementCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\ScheduleServiceCheckCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\ScheduleServiceCheckCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\ScheduleServiceDowntimeCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\ScheduleServiceDowntimeCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\AddCommentCommandForm;
|
||||||
|
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
|
||||||
use Icinga\Module\Monitoring\Object\Host;
|
use Icinga\Module\Monitoring\Object\Host;
|
||||||
use Icinga\Module\Monitoring\Object\Service;
|
use Icinga\Module\Monitoring\Object\Service;
|
||||||
use Icinga\Module\Monitoring\Object\ServiceList;
|
use Icinga\Module\Monitoring\Object\ServiceList;
|
||||||
@ -58,7 +59,8 @@ class Monitoring_ServicesController extends Controller
|
|||||||
'service_is_flapping',
|
'service_is_flapping',
|
||||||
'service_notifications_enabled',
|
'service_notifications_enabled',
|
||||||
'service_output',
|
'service_output',
|
||||||
'service_last_ack'
|
'service_last_ack',
|
||||||
|
'service_last_comment'
|
||||||
));
|
));
|
||||||
|
|
||||||
$form
|
$form
|
||||||
@ -200,18 +202,23 @@ class Monitoring_ServicesController extends Controller
|
|||||||
->handleRequest();
|
->handleRequest();
|
||||||
$this->view->removeAckForm = $removeAckForm;
|
$this->view->removeAckForm = $removeAckForm;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if (! empty($objectsInDowntime)) {
|
if (! empty($objectsInDowntime)) {
|
||||||
$removeDowntimeForm = new DeleteDowntimeCommandForm();
|
$removeDowntimeForm = new DeleteDowntimeCommandForm();
|
||||||
$removeDowntimeForm->setObjects($objectsInDowntime)
|
$removeDowntimeForm
|
||||||
|
->setObjects($objectsInDowntime)
|
||||||
->handleRequest();
|
->handleRequest();
|
||||||
$this->view->removeDowntimeForm = $removeDowntimeForm;
|
$this->view->removeDowntimeForm = $removeDowntimeForm;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
$this->setAutorefreshInterval(15);
|
$this->setAutorefreshInterval(15);
|
||||||
$this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/services/reschedule-check');
|
$this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/services/reschedule-check');
|
||||||
$this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/services/schedule-downtime');
|
$this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/services/schedule-downtime');
|
||||||
$this->view->processCheckResultAllLink = Url::fromRequest()->setPath(
|
$this->view->processCheckResultAllLink = Url::fromRequest()->setPath(
|
||||||
'monitoring/services/process-check-result'
|
'monitoring/services/process-check-result'
|
||||||
);
|
);
|
||||||
|
$this->view->addCommentLink = Url::fromRequest()->setPath('monitoring/services/add-comment');
|
||||||
|
$this->view->deleteCommentLink = Url::fromRequest()->setPath('monitoring/services/delete-comment');
|
||||||
$this->view->hostStates = (object)$hostStates;
|
$this->view->hostStates = (object)$hostStates;
|
||||||
$this->view->serviceStates = (object)$serviceStates;
|
$this->view->serviceStates = (object)$serviceStates;
|
||||||
$this->view->objects = $this->serviceList;
|
$this->view->objects = $this->serviceList;
|
||||||
@ -250,6 +257,33 @@ class Monitoring_ServicesController extends Controller
|
|||||||
->setSparklineClass('sparkline-multi');
|
->setSparklineClass('sparkline-multi');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a service comment
|
||||||
|
*/
|
||||||
|
public function addCommentAction()
|
||||||
|
{
|
||||||
|
$this->assertPermission('monitoring/command/comment/add');
|
||||||
|
|
||||||
|
$form = new AddCommentCommandForm();
|
||||||
|
$form->setTitle($this->translate('Add Service Comments'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a comment
|
||||||
|
*/
|
||||||
|
public function deleteCommentAction()
|
||||||
|
{
|
||||||
|
$this->assertPermission('monitoring/command/comment/delete');
|
||||||
|
|
||||||
|
$form = new DeleteCommentCommandForm();
|
||||||
|
$form->setTitle($this->translate('Delete Service Comments'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acknowledge service problems
|
* Acknowledge service problems
|
||||||
*/
|
*/
|
||||||
|
@ -14,6 +14,11 @@ use Icinga\Web\Url;
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<h3>
|
||||||
|
<?= $this->icon('reschedule') ?>
|
||||||
|
<?= $this->translate('Commands') ?>
|
||||||
|
</h3>
|
||||||
|
|
||||||
<?php if (($serviceCount = count($objects)) === 0): ?>
|
<?php if (($serviceCount = count($objects)) === 0): ?>
|
||||||
<?= $this->translate('No services matching the filter'); ?>
|
<?= $this->translate('No services matching the filter'); ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
@ -41,6 +46,12 @@ use Icinga\Web\Url;
|
|||||||
null,
|
null,
|
||||||
array('icon' => 'reply')
|
array('icon' => 'reply')
|
||||||
); ?></div>
|
); ?></div>
|
||||||
|
<div><?= $this->qlink(
|
||||||
|
$this->translate('Add a comment'),
|
||||||
|
$addCommentLink,
|
||||||
|
null,
|
||||||
|
array('icon' => 'comment')
|
||||||
|
); ?></div>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php if (($unhandledCount = count($unhandledObjects)) > 0): ?>
|
<?php if (($unhandledCount = count($unhandledObjects)) > 0): ?>
|
||||||
@ -127,10 +138,6 @@ use Icinga\Web\Url;
|
|||||||
array('icon' => 'plug')
|
array('icon' => 'plug')
|
||||||
);?>
|
);?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
|
||||||
<?= $removeDowntimeForm ?> Delete All
|
|
||||||
</div>
|
|
||||||
</p>
|
</p>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
@ -145,44 +152,60 @@ use Icinga\Web\Url;
|
|||||||
$commentCount
|
$commentCount
|
||||||
), $commentCount);
|
), $commentCount);
|
||||||
?>
|
?>
|
||||||
|
<p>
|
||||||
|
<table>
|
||||||
|
<?php foreach ($objects as $service): ?>
|
||||||
|
<?php $service->fetchComments(); ?>
|
||||||
|
<?php foreach ($service->comments as $comment): ?>
|
||||||
|
<tr>
|
||||||
|
<td style="vertical-align: top;" data-base-target="_self">
|
||||||
|
<?php
|
||||||
|
$delCommentForm = new DeleteCommentCommandForm();
|
||||||
|
$delCommentForm->populate(
|
||||||
|
array('comment_id' => $comment->id, 'redirect' => html_entity_decode($this->url))
|
||||||
|
);
|
||||||
|
$delCommentForm->setAction(
|
||||||
|
$this->url(
|
||||||
|
'monitoring/service/delete-comment',
|
||||||
|
array('host' => $service->getHost()->getName(), 'service' => $service->getName())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
echo $delCommentForm;
|
||||||
|
?>
|
||||||
|
(<?= ucfirst($comment->type) ?>):
|
||||||
|
</td>
|
||||||
|
<td style="padding-left: .5em;">
|
||||||
|
<?= nl2br($comment->comment) ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</table>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div>
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
$this->translate('List all'),
|
$this->translate('List all'),
|
||||||
$commentsLink,
|
$commentsLink,
|
||||||
null,
|
null,
|
||||||
array('icon' => 'comment')
|
array('icon' => 'comment')
|
||||||
); ?></p>
|
); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<table>
|
<!--
|
||||||
<?php foreach ($objects as $service): ?>
|
TODO: implement backend functionality.
|
||||||
<?php $service->fetchComments(); ?>
|
|
||||||
|
|
||||||
<?php foreach ($service->comments as $comment): ?>
|
<div><?= $this->qlink(
|
||||||
<tr >
|
$this->translate('Remove all'),
|
||||||
<td style="vertical-align: top;" data-base-target="_self">
|
$deleteCommentLink,
|
||||||
<?php
|
null,
|
||||||
$delCommentForm = new DeleteCommentCommandForm();
|
array('icon' => 'trash')
|
||||||
$delCommentForm->populate(
|
); ?></div>
|
||||||
array('comment_id' => $comment->id, 'redirect' => html_entity_decode($this->url))
|
</p>
|
||||||
);
|
-->
|
||||||
$delCommentForm->setAction(
|
|
||||||
$this->url(
|
|
||||||
'monitoring/service/delete-comment',
|
|
||||||
array('host' => $service->getHost()->getName(), 'service' => $service->getName())
|
|
||||||
)
|
|
||||||
);
|
|
||||||
echo $delCommentForm;
|
|
||||||
?>
|
|
||||||
(<?= ucfirst($comment->type) ?>):
|
|
||||||
</td>
|
|
||||||
<td style="padding-left: .5em;">
|
|
||||||
<?= nl2br($comment->comment) ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach ?>
|
|
||||||
|
|
||||||
<?php endforeach ?>
|
|
||||||
</table>
|
<?php endif ?>
|
||||||
<?php endif ?>
|
|
||||||
|
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
Loading…
x
Reference in New Issue
Block a user