Fix the layout errors

Pull all containers in the host and service view to the left site. Change the
layout of the comments view to display the comments properly.

fixes #4934
This commit is contained in:
Matthias Jentsch 2013-10-20 19:59:37 +02:00
parent cc5fa0a7b4
commit 9e9142055f
3 changed files with 57 additions and 46 deletions

View File

@ -13,23 +13,13 @@ $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 +45,66 @@ $viewHelper = $this->getHelper('MonitoringState');
) )
); );
?> ?>
<tr <?= ($this->activeRowHref === $detailLink) ? 'class="active"' : ''; ?>> <tr>
<td> <td>
<a class="hidden" href="<?= $detailLink; ?>"></a> <a class="hidden" href="<?= $detailLink; ?>"></a>
<?php if ($comment->comment_objecttype_id === '1'): ?> <?php if ($comment->comment_objecttype_id === '1'): ?>
{{{ICON_HOST}}} <i class="icinga-icon-host" rel="tooltip" title="Host comment" ></i>
<?php elseif ($comment->comment_objecttype_id === '2'): ?> <?php elseif ($comment->comment_objecttype_id === '2'): ?>
{{{ICON_SERVICE}}} <i class="icinga-icon-service" rel="tooltip" title="Service comment"></i>
<?php endif; ?> <?php endif; ?>
</td> </td>
<td> <td>
<?= $comment->comment_id; ?> <small>
</td> <?php
<td> switch ($comment->comment_type) {
<?= $comment->comment_type; ?> case 'flapping':
</td> $icon = 'icinga-icon-flapping';
<td> $tooltip = 'Comment is caused by a flapping host or service.';
<a href="<?= $hostLink ?>"> break;
<?= $comment->host_name; ?> }
</a> ?>
<i class="<?= $icon ?>" rel="tooltip" title="<?= $tooltip ?>"> </i>
</small>
</td> </td>
<div rel="tooltip" title="Comment #<?=$comment->comment_id ?>">
<td> <td>
<?php if ($comment->service_name): ?> <?php if ($comment->service_name): ?>
<a href="<?= $detailLink ?>"> <a href="<?= $detailLink ?>">
<?= $comment->service_name ?> <?= $comment->service_name ?>
</a> </a>
on
<?php else: ?> <?php else: ?>
&nbsp; &nbsp;
<?php endif; ?> <?php endif; ?>
<a href="<?= $hostLink ?>">
<?= $comment->host_name; ?>
</a>
</td> </td>
<td> <td>
<?= $dateHelper->formatDateTime($comment->comment_timestamp); ?> <?= date('d.m. H:i', $comment->comment_timestamp); ?>
</td> </td>
<td> <td>
<?= $comment->comment_author; ?> <?= $comment->comment_author; ?>
</td> </td>
<td> <td>
<span data-icinga-component="app/ellipsisText"> <div class="small-row">
<?= $comment->comment_data; ?> <?= $comment->comment_data; ?>
</span> </div>
</td> </td>
<td> <td>
<?= ($comment->comment_is_persistent === '1') ? 'Yes' : 'No'; ?> <?= ($comment->comment_is_persistent === '1') ? 'Yes' : 'No'; ?>
</td> </td>
<td> <td>
<?= <small>
expires <br /> <?=
($comment->comment_expiration_timestamp) ? ($comment->comment_expiration_timestamp) ?
$dateHelper->formatDateTime($comment->comment_expiration_timestamp) : 'at ' . date('d.m H:i', $comment->comment_expiration_timestamp) :
'Never'; 'Never';
?> ?> </small>
</td> </td>
<td> <td>
<?php <?php
@ -125,6 +126,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>
<div class="pull-left">
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?> <?= $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>
<div class="pull-left">
<?= $this->paginationControl($this->services, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($this->services, null, null, array('preserve' => $this->preserve)); ?>
</div>
</div> </div>