mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-21 17:07:53 +02:00
downtimes-header: Be more efficient when listing downtimes
This commit is contained in:
parent
bba57d2bbc
commit
006d2cb537
@ -2,7 +2,7 @@
|
||||
<tbody>
|
||||
<?php $i = 0; foreach ($downtimes as $downtime):
|
||||
if (++ $i > 5) {
|
||||
continue;
|
||||
break;
|
||||
} ?>
|
||||
<tr class="state <?= $downtime->stateText ?>">
|
||||
<td class="state">
|
||||
@ -68,18 +68,18 @@
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<?php if ($i > 5): ?>
|
||||
<?php if (count($downtimes) > 5): ?>
|
||||
<p>
|
||||
<?= $this->qlink(
|
||||
sprintf($this->translate('show all %d downtimes'), $i),
|
||||
$listAllLink,
|
||||
null,
|
||||
array(
|
||||
'icon' => $i > 5 ? 'down-open' : '',
|
||||
'data-base-target' => "_next"
|
||||
'icon' => 'down-open',
|
||||
'data-base-target' => "_next"
|
||||
)
|
||||
) ?>
|
||||
<?php endif ?>
|
||||
</p>
|
||||
</p>
|
||||
<?php endif ?>
|
Loading…
x
Reference in New Issue
Block a user