monitoring: Remove unnecessary controls in the service grid view

This commit is contained in:
Eric Lippmann 2015-11-03 12:37:23 +01:00
parent 031c5af9fd
commit cb4b460f3f
1 changed files with 36 additions and 46 deletions

View File

@ -4,30 +4,20 @@ use Icinga\Web\Url;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls separated"> <div class="controls separated">
<?= $this->tabs; ?> <?= $this->tabs ?>
<div class="grid dont-print"> <div class="grid">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?> <?= $this->sortBox ?>
</div> </div>
</div> <?= $this->filterEditor ?>
<?= $this->filterEditor; ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">
<?php <?php if (empty($pivotData)): ?>
if (empty($pivotData)) { <p><?= $this->translate('No services found matching the filter.') ?></p>
echo $this->translate('No services found matching the filter') . '</div>'; </div>
return; <?php return; endif;
}
$hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . ')'; $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . ')';
?> ?>
<table class="service-grid-table"> <table class="service-grid-table">
<thead> <thead>
<tr> <tr>
@ -38,7 +28,7 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
'xAxisPaginator' => $horizontalPaginator, 'xAxisPaginator' => $horizontalPaginator,
'yAxisPaginator' => $verticalPaginator 'yAxisPaginator' => $verticalPaginator
) )
); ?></th> ) ?></th>
<?php foreach ($pivotHeader['cols'] as $serviceDescription => $serviceDisplayName): ?> <?php foreach ($pivotHeader['cols'] as $serviceDescription => $serviceDisplayName): ?>
<th class="rotate-45"><div><span><?= $this->qlink( <th class="rotate-45"><div><span><?= $this->qlink(
$this->ellipsis($serviceDisplayName, 18), $this->ellipsis($serviceDisplayName, 18),
@ -55,7 +45,7 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
</thead> </thead>
<tbody> <tbody>
<?php $i = 0; ?> <?php $i = 0 ?>
<?php foreach ($pivotHeader['rows'] as $hostName => $hostDisplayName): ?> <?php foreach ($pivotHeader['rows'] as $hostName => $hostDisplayName): ?>
<tr> <tr>
<th><?php <th><?php
@ -88,15 +78,15 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
), ),
array( array(
'aria-describedby' => $ariaDescribedById, 'aria-describedby' => $ariaDescribedById,
'class' => 'bg-color-' . Service::getStateText($service->service_state) . ($service->service_handled ? ' handled' : ''),
'title' => $this->escape($service->service_output),
'aria-label' => sprintf( 'aria-label' => sprintf(
$this->translate('Show detailed information for service %s on host %s'), $this->translate('Show detailed information for service %s on host %s'),
$service->service_display_name, $service->service_display_name,
$service->host_display_name $service->host_display_name
),
'class' => 'bg-color-' . Service::getStateText($service->service_state) . ($service->service_handled ? ' handled' : ''),
'title' => $this->escape($service->service_output)
) )
) ) ?>
); ?>
</td> </td>
<?php endforeach ?> <?php endforeach ?>
<?php if (! $this->compact && $this->horizontalPaginator->getPages()->pageCount > 1): ?> <?php if (! $this->compact && $this->horizontalPaginator->getPages()->pageCount > 1): ?>
@ -110,16 +100,16 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
. $this->verticalPaginator->getItemCountPerPage() . $this->verticalPaginator->getItemCountPerPage()
), ),
array( array(
'data-base-target' => '_self', 'class' => 'action-link',
'class' => 'action-link' 'data-base-target' => '_self'
) )
) ?> ) ?>
<?= ++$i === (int) (count($pivotHeader['rows']) / 2) ? $expandLink : '' ?> <?= ++$i === (int) (count($pivotHeader['rows']) / 2) ? $expandLink : '' ?>
</td> </td>
<?php endif;?> <?php endif ?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
<?php if (! $this->compact && $this->verticalPaginator->getPages()->pageCount > 1): ;?> <?php if (! $this->compact && $this->verticalPaginator->getPages()->pageCount > 1): ?>
<tr> <tr>
<td colspan="<?= count($pivotHeader['cols']) + 1?>" class="service-grid-table-more"> <td colspan="<?= count($pivotHeader['cols']) + 1?>" class="service-grid-table-more">
<?php echo $this->qlink( <?php echo $this->qlink(
@ -130,13 +120,13 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
($this->verticalPaginator->getItemCountPerPage() + 20) ($this->verticalPaginator->getItemCountPerPage() + 20)
), ),
array( array(
'data-base-target' => '_self', 'class' => 'action-link',
'class' => 'action-link' 'data-base-target' => '_self'
) )
) ?> ) ?>
</td> </td>
</tr> </tr>
<?php endif;?> <?php endif ?>
</tbody> </tbody>
</table> </table>
</div> </div>