icingaweb2/modules/monitoring/application/views/scripts/show/components/comments.phtml

62 lines
2.2 KiB
PHTML

<div>
<div class="panel-heading">
<div class="panel-hostname">
Comments
<?php
$data = array(
'host' => $object->host_name
);
if ($object->service_description) {
$data['service'] = $object->service_description;
}
$addCommentHref = $this->href(
'monitoring/command/addComment',
$data
);
$sendNotificationHref = $this->href(
'monitoring/command/sendCustomNotification',
$data
);
?>
<div class="pull-right">
<a href="<?= $addCommentHref; ?>" class="btn-common btn-small button">
<i class="icinga-icon-comment"></i>
</a>
<a href="<?= $sendNotificationHref; ?>" class="btn-common btn-small button">
<i class="icinga-icon-notification"></i>
</a>
</div>
</div>
</div>
<hr class="separator" />
<div class="panel-body">
<table class="table table-condensed table-detail">
<tbody>
<?php if (empty($object->comments)): ?>
<tr>
<td>No comments</td>
</tr>
<?php endif; ?>
<?php foreach ($object->comments as $comment): ?>
<tr>
<td>
<div class="pull-right">
<form>
<button type="submit" value="1" class="button btn-small btn-common" title="Remove comment">
<i class="icinga-icon-remove"></i>
</button>
</form>
</div>
<?= $this->escape($comment->comment_author); ?>, <?= $comment->comment_type; ?>
(<?= $this->format()->timeSince($comment->comment_timestamp); ?>)
<div class="small-row">
<?= $this->escape($comment->comment_data); ?>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>