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

224 lines
6.6 KiB
PHTML
Raw Normal View History

<?php
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
?>
<div class="controls">
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<h1>
<?= $this->qlink(
sprintf($this->translate('%d Hosts Selected'), count($objects)),
$listAllLink
); ?>
</h1>
<?= $this->render('partials/host/objects-header.phtml'); ?>
</div>
<div class="content">
<h3>
<?= $this->icon('reschedule') ?>
<?= $this->translate('Commands') ?>
</h3>
<?= sprintf(t('Issue commands on all %d selected hosts:'), count($objects)) ?>
2015-02-02 16:28:35 +01:00
<?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 the next check'),
$rescheduleAllLink,
null,
array('icon' => 'reschedule')
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Schedule a downtime'),
$downtimeAllLink,
null,
array('icon' => 'plug')
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Submit a passive check result'),
$processCheckResultAllLink,
null,
array('icon' => 'reply')
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Add a comment'),
$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(
t('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->translate('Downtimes') ?></h3>
<p><?= sprintf(
$this->translatePlural(
'%u Host currently in downtime.',
'%u Hosts currently in downtime.',
$inDowntimeCount
),
$inDowntimeCount
) ?> <?= $this->qlink(
$this->translate('Alle anzeigen'),
$inDowntimeLink,
null
); ?>
</p>
<?php endif ?>
<?php if (($commentCount = count($objects->getComments())) > 0): ?>
<h3> <?= $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
); ?>
</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>