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

73 lines
2.6 KiB
PHTML

<?php
/** @var Zend_View_Helper_CommandForm $cf */
$cf = $this->getHelper('CommandForm');
?>
<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 rel="tooltip" title="Add a comment" href="<?= $addCommentHref; ?>" class="btn-common btn-small button">
<i class="icinga-icon-comment"></i>
</a>
<a rel="tooltip" title="Send custom notification" 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">
<?php
$deleteData = $data;
$deleteData['commentid'] = $comment->comment_internal_id;
echo $cf->iconSubmitForm(
'icinga-icon-remove',
'Remove comment',
'btn-small',
'removecomment',
$deleteData
);
?>
</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>