icingaweb2/modules/monitoring/application/views/scripts/hosts/show.phtml

221 lines
6.8 KiB
PHTML

<?php
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
?>
<div class="controls">
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<?= $this->render('partials/host/objects-tinysummary.phtml') ?>
<?= $this->render('partials/host/objects-header.phtml'); ?>
</div>
<div class="content no-padding-top">
<h3>
<?= $this->icon('reschedule') ?>
<?= $this->translate('Commands') ?>
</h3>
<?= sprintf($this->translate('Issue commands to all %d selected hosts:'), count($objects)) ?>
<?php if (($hostCount = count($objects)) === 0): ?>
<?= $this->translate('No hosts matching the filter'); ?>
<?php else: ?>
<p>
<div>
<?= $checkNowForm; ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Reschedule next checks'),
$rescheduleAllLink,
null,
array('icon' => 'reschedule')
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Schedule downtimes'),
$downtimeAllLink,
null,
array('icon' => 'plug')
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Submit passive check results'),
$processCheckResultAllLink,
null,
array('icon' => 'reply')
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Add comments'),
$addCommentLink,
null,
array('icon' => 'comment')
); ?>
</div>
</p>
<?php if (($unhandledCount = count($unhandledObjects)) > 0): ?>
<div>
<h3>
<?= $this->icon('attention-alt') ?>
<?= $this->translatePlural(
'Unhandled Problem',
'Unhandled Problems',
$unhandledCount
) ?>
</h3>
<p>
<?= sprintf(
$this->translate('There are %s unhandled problems. Issue commands to the problematic hosts:'),
'<span class="badge badge-critical">' . $unhandledCount . '</span>'
) ?>
<div><?= $this->qlink(
sprintf(
$this->translatePlural(
'Schedule a downtime for %u host',
'Schedule a downtime for %u hosts',
$unhandledCount
),
$unhandledCount
),
$downtimeUnhandledLink,
null,
array('icon' => 'plug')
); ?></div>
<div><?= $this->qlink(
sprintf(
$this->translatePlural(
'Acknowledge %u unhandled host',
'Acknowledge %u unhandled hosts',
$unhandledCount
),
$unhandledCount
),
$acknowledgeUnhandledLink,
null,
array('icon' => 'ok')
); ?></div>
</p>
</div>
<?php endif ?>
<?php if (($acknowledgedCount = count($acknowledgedObjects)) > 0): ?>
<div>
<h3><?= $this->icon('ok', $this->translate('Acknowledgements')) ?> <?= $this->translate('Acknowledgements') ?></h3>
<p><?= sprintf(
$this->translatePlural(
'%u Acknowledged Host Problem',
'%u Acknowledged Host Problems',
$acknowledgedCount
),
$acknowledgedCount
); ?></p>
<?= $removeAckForm ?>
</div>
<?php endif ?>
<?php if (($inDowntimeCount = count($objectsInDowntime)) > 0): ?>
<h3><?= $this->icon('plug', $this->translate('Downtimes'))?> <?=$this->translate('Downtimes')?></h3>
<p><?= sprintf(
$this->translatePlural(
'%u Host currently in downtime.',
'%u Hosts currently in downtime.',
$inDowntimeCount
),
$inDowntimeCount
) ?> <?= $this->qlink(
$this->translate('List all'),
$inDowntimeLink,
null,
array('data-base-target' => '_next')
); ?>
</p>
<?php endif ?>
<?php if (($commentCount = count($objects->getComments())) > 0): ?>
<h3> <?= $this->icon('comment', $this->translate('Comments'))?> <?=$this->translate('Comments') ?></h3>
<p>
<?= sprintf(
$this->translatePlural(
'There is %u host comment.',
'There are %u host comments.',
$commentCount
),
$commentCount
) ?>
<?= $this->qlink(
$this->translate('List all'),
$commentsLink,
null,
array('data-base-target' => '_next')
); ?>
</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/host/delete-comment',
array('host' => $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->translate('Remove all'),
$deleteCommentLink,
null,
array('icon' => 'trash')
); ?></div>
</p>
-->
<?php endif ?>
<?php endif ?>
</div>