monitoring: Update content markup in downtimes

This commit is contained in:
Eric Lippmann 2016-03-31 09:33:21 +02:00
parent f135e4d0d2
commit bd3d40d46d

View File

@ -4,7 +4,7 @@ use Icinga\Module\Monitoring\Object\Service;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $tabs ?> <?= $this->tabs ?>
<?= $this->render('list/components/selectioninfo.phtml') ?> <?= $this->render('list/components/selectioninfo.phtml') ?>
<?= $this->paginator ?> <?= $this->paginator ?>
<div class="sort-controls-container"> <div class="sort-controls-container">
@ -15,39 +15,44 @@ if (! $this->compact): ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<table data-base-target="_next" <?php if (! $downtimes->hasResult()): ?>
class="table-row-selectable state-table multiselect common-table" <p><?= $this->translate('No downtimes found matching the filter.') ?></p>
data-icinga-multiselect-url="<?= $this->href('monitoring/downtimes/show'); ?>" </div>
data-icinga-multiselect-controllers="<?= $this->href("monitoring/downtimes") ?>" <?php return; endif ?>
data-icinga-multiselect-data="downtime_id"> <table class="common-table state-table table-row-selectable multiselect"
data-base-target="_next"
data-icinga-multiselect-url="<?= $this->href('monitoring/downtimes/show') ?>"
data-icinga-multiselect-controllers="<?= $this->href("monitoring/downtimes") ?>"
data-icinga-multiselect-data="downtime_id">
<tbody> <tbody>
<?php foreach ($downtimes->peekAhead($this->compact) as $downtime): <?php foreach ($downtimes->peekAhead($this->compact) as $downtime):
if (isset($downtime->service_description)) { if (isset($downtime->service_description)) {
$this->isService = true; $this->isService = true;
$this->stateName = Service::getStateText($downtime->service_state); $this->stateName = Service::getStateText($downtime->service_state);
} else { } else {
$this->isService = false; $this->isService = false;
$this->stateName = Host::getStateText($downtime->host_state); $this->stateName = Host::getStateText($downtime->host_state);
} }
$this->downtime = $downtime; // Set downtime for partials
?> $this->downtime = $downtime;
<tr href="<?= $this->href('monitoring/downtime/show', array('downtime_id' => $downtime->id)) ?>"> ?>
<?= $this->render('partials/downtime/downtime-header.phtml'); ?> <tr href="<?= $this->href('monitoring/downtime/show', array('downtime_id' => $downtime->id)) ?>">
</tr> <?= $this->render('partials/downtime/downtime-header.phtml') ?>
</tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<?php if (! $downtimes->hasResult()): ?> <?php if ($downtimes->hasMore()): ?>
<?= $this->translate('No downtimes found matching the filter, maybe the downtime already expired.'); ?> <div class="action-links">
<?php elseif ($downtimes->hasMore()): ?> <?= $this->qlink(
<?= $this->qlink( $this->translate('Show More'),
$this->translate('Show More'), $this->url()->without(array('view', 'limit')),
$this->url()->without(array('view', 'limit')), null,
null, array(
array( 'class' => 'action-link',
'data-base-target' => '_next', 'data-base-target' => '_next'
'class' => 'pull-right action-link' )
) ) ?>
); ?> </div>
<?php endif ?> <?php endif ?>
</div> </div>