mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
event-history.phtml: Don't use hasResult()
to check if there are results
28ec1e236 has no result on history views as they never count their results. So restructuring this particular view script I deemed reasonable since the history queries tend to show very poor performance. refs #3905 refs #3836
This commit is contained in:
parent
8e5380220c
commit
cbc12ab31e
@ -29,19 +29,17 @@ if (! $url->hasParam('page') || ($page = (int) $url->getParam('page')) < 1) {
|
|||||||
$history->limit($limit * $page);
|
$history->limit($limit * $page);
|
||||||
?>
|
?>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<?php if (! $history->hasResult()): ?>
|
|
||||||
<p><?= $this->translate('No historical events found matching the filter.') ?></p>
|
|
||||||
</div>
|
|
||||||
<?php return; endif ?>
|
|
||||||
<?php
|
<?php
|
||||||
$dateFormat = $this->translate('%A, %B %e, %Y', 'date.verbose');
|
$dateFormat = $this->translate('%A, %B %e, %Y', 'date.verbose');
|
||||||
$lastDate = null;
|
$lastDate = null;
|
||||||
$flappingMsg = $this->translate('Flapping with a %.2f%% state change rate');
|
$flappingMsg = $this->translate('Flapping with a %.2f%% state change rate');
|
||||||
$rowAction = Url::fromPath('monitoring/event/show');
|
$rowAction = Url::fromPath('monitoring/event/show');
|
||||||
?>
|
?>
|
||||||
|
<?php foreach ($history->peekAhead() as $event): ?>
|
||||||
|
<?php if ($lastDate === null): ?>
|
||||||
<table class="table-row-selectable state-table" data-base-target="_next">
|
<table class="table-row-selectable state-table" data-base-target="_next">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($history->peekAhead() as $event):
|
<?php endif;
|
||||||
$icon = '';
|
$icon = '';
|
||||||
$iconTitle = null;
|
$iconTitle = null;
|
||||||
$isService = isset($event->service_description);
|
$isService = isset($event->service_description);
|
||||||
@ -240,8 +238,10 @@ $rowAction = Url::fromPath('monitoring/event/show');
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
<?php if ($lastDate !== null): ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<?php endif ?>
|
||||||
<?php if ($history->hasMore()): ?>
|
<?php if ($history->hasMore()): ?>
|
||||||
<div class="action-links">
|
<div class="action-links">
|
||||||
<?php if ($this->compact) {
|
<?php if ($this->compact) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user