Improve layout of comment view

Change each table row layout to display the data in horizontal rows instead of
single columns

fixes #4934
This commit is contained in:
Matthias Jentsch 2013-10-22 10:33:10 +02:00
parent 9e9142055f
commit 7614dcbbe8
2 changed files with 56 additions and 47 deletions

View File

@ -288,7 +288,8 @@ class Monitoring_ListController extends MonitoringController
'comment_timestamp' => 'Comment Timestamp', 'comment_timestamp' => 'Comment Timestamp',
'host_service' => 'Host and Service', 'host_service' => 'Host and Service',
'comment_id' => 'Comment Id', 'comment_id' => 'Comment Id',
'comment_expires' => 'Expiration Timestamp' 'comment_expires' => 'Expiration Timestamp',
'comment_type' => 'Comment Type'
) )
); );
$this->handleFormatRequest($query); $this->handleFormatRequest($query);

View File

@ -16,7 +16,6 @@ $viewHelper = $this->getHelper('MonitoringState');
<?= $this->sortControl->render($this); ?> <?= $this->sortControl->render($this); ?>
<?= $this->paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?>
<table class="table table-condensed"> <table class="table table-condensed">
@ -46,64 +45,73 @@ $viewHelper = $this->getHelper('MonitoringState');
); );
?> ?>
<tr> <tr>
<td>
<?= date('d.m. H:i', $comment->comment_timestamp); ?>
</td>
<td>
<?php if ($comment->comment_objecttype_id === '1'): ?>
<i class="icinga-icon-host" rel="tooltip" title="Host comment" ></i>
<?php elseif ($comment->comment_objecttype_id === '2'): ?>
<i class="icinga-icon-service" rel="tooltip" title="Service comment"></i>
<?php endif; ?>
<small>
<?php
switch ($comment->comment_type) {
case 'flapping':
$icon = 'icinga-icon-flapping';
$tooltip = 'Comment was caused by a flapping host or service.';
break;
case 'comment':
$icon = 'icinga-icon-user';
$tooltip = 'Comment was created by an user.';
break;
case 'downtime':
$icon = 'icinga-icon-down';
$tooltip = 'Comment was caused by a downtime.';
case 'ack':
$icon = 'icinga-icon-acknowledgement';
$tooltip = 'Comment was caused by an acknowledgement.';
}
?>
<i class="<?= $icon ?>" rel="tooltip" title="<?= $tooltip ?>"> </i>
</small>
</td>
<td> <td>
<a class="hidden" href="<?= $detailLink; ?>"></a> <a class="hidden" href="<?= $detailLink; ?>"></a>
<?php if ($comment->comment_objecttype_id === '1'): ?>
<i class="icinga-icon-host" rel="tooltip" title="Host comment" ></i>
<?php elseif ($comment->comment_objecttype_id === '2'): ?>
<i class="icinga-icon-service" rel="tooltip" title="Service comment"></i>
<?php endif; ?>
</td>
<td> <div rel="tooltip" title="Comment #<?=$comment->comment_id ?>">
<small> For
<?php
switch ($comment->comment_type) {
case 'flapping':
$icon = 'icinga-icon-flapping';
$tooltip = 'Comment is caused by a flapping host or service.';
break;
}
?>
<i class="<?= $icon ?>" rel="tooltip" title="<?= $tooltip ?>"> </i>
</small>
</td>
<div rel="tooltip" title="Comment #<?=$comment->comment_id ?>">
<td>
<?php if ($comment->service_name): ?> <?php if ($comment->service_name): ?>
<a href="<?= $detailLink ?>"> <a href="<?= $detailLink ?>">
<?= $comment->service_name ?> <?= $comment->service_name ?>
on
<?= $comment->host_name; ?>
</a> </a>
on
<?php else: ?> <?php else: ?>
&nbsp; <a href="<?= $hostLink ?>">
<?= $comment->host_name; ?>
</a>
<?php endif; ?> <?php endif; ?>
<a href="<?= $hostLink ?>"> by
<?= $comment->host_name; ?> <?= $comment->comment_author; ?>
</a>
</td>
<td>
<?= date('d.m. H:i', $comment->comment_timestamp); ?>
</td>
<td>
<?= $comment->comment_author; ?>
</td>
<td>
<div class="small-row"> <div class="small-row">
<?= $comment->comment_data; ?> <?= $comment->comment_data; ?>
</div> </div>
</td>
<td>
<?= ($comment->comment_is_persistent === '1') ? 'Yes' : 'No'; ?>
</td>
<td>
<small> <small>
expires <br /> <?= <span>
($comment->comment_expiration_timestamp) ? <b>Persists: </b><?= ($comment->comment_is_persistent === '1') ? 'Yes' : 'No'; ?>
'at ' . date('d.m H:i', $comment->comment_expiration_timestamp) : </span>
'Never'; <span>
?> </small> <b>Expires: </b> <?=
($comment->comment_expiration_timestamp) ?
'at ' . date('d.m H:i', $comment->comment_expiration_timestamp) :
'Never';
?>
</span>
</small>
</td> </td>
<td> <td>