Merge branch 'bugfix/layout-errors-4934'

This commit is contained in:
Matthias Jentsch 2013-10-22 10:43:08 +02:00
commit d3b234d47a
4 changed files with 89 additions and 69 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

@ -13,23 +13,12 @@ $viewHelper = $this->getHelper('MonitoringState');
<h1>Comments</h1> <h1>Comments</h1>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single">
<?= $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">
<thead>
<tr>
<th colspan="2">Comment Id</th>
<th>Type</th>
<th>Host</th>
<th>Service</th>
<th>Entry Time</th>
<th>Author</th>
<th>Comment</th>
<th>Persistent</th>
<th colspan="2">Expires</th>
</tr>
</thead>
<tbody> <tbody>
<?php foreach ($comments as $comment): ?> <?php foreach ($comments as $comment): ?>
<?php <?php
@ -55,55 +44,75 @@ $viewHelper = $this->getHelper('MonitoringState');
) )
); );
?> ?>
<tr <?= ($this->activeRowHref === $detailLink) ? 'class="active"' : ''; ?>> <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'): ?>
{{{ICON_HOST}}} <div rel="tooltip" title="Comment #<?=$comment->comment_id ?>">
<?php elseif ($comment->comment_objecttype_id === '2'): ?> For
{{{ICON_SERVICE}}} <?php if ($comment->service_name): ?>
<?php endif; ?> <a href="<?= $detailLink ?>">
</td> <?= $comment->service_name ?>
<td> on
<?= $comment->comment_id; ?> <?= $comment->host_name; ?>
</td> </a>
<td> <?php else: ?>
<?= $comment->comment_type; ?> <a href="<?= $hostLink ?>">
</td> <?= $comment->host_name; ?>
<td> </a>
<a href="<?= $hostLink ?>"> <?php endif; ?>
<?= $comment->host_name; ?> by
</a> <?= $comment->comment_author; ?>
</td> <div class="small-row">
<td> <?= $comment->comment_data; ?>
<?php if ($comment->service_name): ?> </div>
<a href="<?= $detailLink ?>">
<?= $comment->service_name ?> <small>
</a> <span>
<?php else: ?> <b>Persists: </b><?= ($comment->comment_is_persistent === '1') ? 'Yes' : 'No'; ?>
&nbsp; </span>
<?php endif; ?> <span>
</td> <b>Expires: </b> <?=
<td> ($comment->comment_expiration_timestamp) ?
<?= $dateHelper->formatDateTime($comment->comment_timestamp); ?> 'at ' . date('d.m H:i', $comment->comment_expiration_timestamp) :
</td> 'Never';
<td> ?>
<?= $comment->comment_author; ?> </span>
</td> </small>
<td>
<span data-icinga-component="app/ellipsisText">
<?= $comment->comment_data; ?>
</span>
</td>
<td>
<?= ($comment->comment_is_persistent === '1') ? 'Yes' : 'No'; ?>
</td>
<td>
<?=
($comment->comment_expiration_timestamp) ?
$dateHelper->formatDateTime($comment->comment_expiration_timestamp) :
'Never';
?>
</td> </td>
<td> <td>
<?php <?php
@ -125,6 +134,7 @@ $viewHelper = $this->getHelper('MonitoringState');
); );
?> ?>
</td> </td>
</div>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>

View File

@ -5,6 +5,7 @@ $viewHelper = $this->getHelper('MonitoringState');
<?= $this->tabs->render($this); ?> <?= $this->tabs->render($this); ?>
<h1>Hosts Status</h1> <h1>Hosts Status</h1>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="multi"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="multi">
<div class="container pull-left"> <div class="container pull-left">
<div class="row"> <div class="row">
<div class="col-md-5"> <div class="col-md-5">
@ -17,20 +18,19 @@ $viewHelper = $this->getHelper('MonitoringState');
<div class="row"> <div class="row">
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
<div> <div class="row">
Select Select
<a href='<?=$this->href('monitoring/multi/host',array( 'host' => '*' ))?>'> All </a> <a href='<?=$this->href('monitoring/multi/host',array( 'host' => '*' ))?>'> All </a>
<a href='#'> None </a> <a href='#'> None </a>
</div> </div>
</div> </div>
<table class="table table-condensed">
<table class="table table-condensed pull-left">
<tbody> <tbody>
<?php foreach($hosts as $host): ?> <?php foreach($hosts as $host): ?>
<?php $hostStateName = strtolower($this->util()->getHostStateName($host->host_state)); ?> <?php $hostStateName = strtolower($this->util()->getHostStateName($host->host_state)); ?>
<?php $hostLink = $this->href('monitoring/show/host', array('host' => $host->host_name)); ?> <?php $hostLink = $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>
<tr <?= ($this->activeRowHref === $hostLink) ? 'class="active"' : ''; ?> > <tr>
<!-- Color column --> <!-- Color column -->
<td class="tacheader-status-<?= $hostStateName; ?>"> <td class="tacheader-status-<?= $hostStateName; ?>">
@ -130,5 +130,8 @@ $viewHelper = $this->getHelper('MonitoringState');
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?>
<div class="pull-left">
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?>
</div>
</div> </div>

View File

@ -5,6 +5,7 @@ $viewHelper = $this->getHelper('MonitoringState');
<?= $this->tabs->render($this); ?> <?= $this->tabs->render($this); ?>
<h1>Services Status</h1> <h1>Services Status</h1>
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="multi"> <div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="multi">
<div class="container pull-left"> <div class="container pull-left">
<div class="row"> <div class="row">
<div class="col-md-5"> <div class="col-md-5">
@ -17,13 +18,14 @@ $viewHelper = $this->getHelper('MonitoringState');
<div class="row"> <div class="row">
<?= $this->paginationControl($services, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($services, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
<div> <div class="row">
Select Select
<a href='<?=$this->href('monitoring/multi/service',array( 'host' => '*', 'service' => '*' ))?>'> All </a> <a href='<?=$this->href('monitoring/multi/service',array( 'host' => '*', 'service' => '*' ))?>'> All </a>
<a href='#'> None </a> <a href='#'> None </a>
</div> </div>
</div> </div>
<table class="table table-condensed">
<table class="table table-condensed pull-left">
<tbody> <tbody>
<?php foreach ($services as $service): ?> <?php foreach ($services as $service): ?>
<?php <?php
@ -136,5 +138,9 @@ $viewHelper = $this->getHelper('MonitoringState');
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
<?= $this->paginationControl($this->services, null, null, array('preserve' => $this->preserve)); ?>
<div class="pull-left">
<?= $this->paginationControl($this->services, null, null, array('preserve' => $this->preserve)); ?>
</div>
</div> </div>