icingaweb2/modules/monitoring/application/views/scripts/partials/comment/comment-header.phtml

58 lines
1.9 KiB
PHTML

<table class="action">
<tr class="state invalid">
<td class="state">
<?php
switch ($comment->type) {
case 'flapping':
$icon = 'flapping';
$title = $this->translate('Flapping');
$tooltip = $this->translate('Comment was caused by a flapping host or service.');
break;
case 'comment':
$icon = 'user';
$title = $this->translate('User Comment');
$tooltip = $this->translate('Comment was created by an user.');
break;
case 'downtime':
$icon = 'plug';
$title = $this->translate('Downtime');
$tooltip = $this->translate('Comment was caused by a downtime.');
break;
case 'ack':
$icon = 'ok';
$title = $this->translate('Acknowledgement');
$tooltip = $this->translate('Comment was caused by an acknowledgement.');
break;
}
?>
<strong><?= $this->escape($title); ?></strong>
<br>
<?= $this->icon($icon, $tooltip) ?>
<?= $this->prefixedTimeSince($comment->timestamp); ?>
</td>
<td>
<?php if ($comment->objecttype === 'service'): ?>
<?= $this->icon('service', $this->translate('Service')); ?>
<?= $this->link()->service(
$comment->service_description,
$comment->service_display_name,
$comment->host_name,
$comment->host_display_name
); ?>
<?php else: ?>
<?= $this->icon('host', $this->translate('Host')); ?>
<?= $this->link()->host($comment->host_name, $comment->host_display_name); ?>
<?php endif ?>
<br>
<?= $this->icon('comment', $this->translate('Comment')); ?> <?= isset($comment->author)
? '[' . $comment->author . '] '
: '';
?><?= $this->escape($comment->comment); ?>
</td>
</tr>
</table>