mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
list/statehistorysummary: fix filter links
This commit is contained in:
parent
22b3b0e46a
commit
adab58e769
@ -1,4 +1,8 @@
|
|||||||
<div class="controls">
|
<?php
|
||||||
|
|
||||||
|
use Icinga\Data\Filter\Filter;
|
||||||
|
|
||||||
|
?><div class="controls">
|
||||||
<?= $this->tabs ?>
|
<?= $this->tabs ?>
|
||||||
<h1>History - Critical Events</h1>
|
<h1>History - Critical Events</h1>
|
||||||
</div>
|
</div>
|
||||||
@ -16,19 +20,20 @@ foreach ($summary as $entry) {
|
|||||||
$value = $entry->cnt_critical;
|
$value = $entry->cnt_critical;
|
||||||
$caption = $value . ' ' .
|
$caption = $value . ' ' .
|
||||||
t('critical events on ') . $this->dateFormat()->formatDate(strtotime($day));
|
t('critical events on ') . $this->dateFormat()->formatDate(strtotime($day));
|
||||||
|
$filter = Filter::matchAll(
|
||||||
|
Filter::expression('timestamp', '<', strtotime($day . ' 23:59:59')),
|
||||||
|
Filter::expression('timestamp', '>', strtotime($day . ' 00:00:00')),
|
||||||
|
Filter::expression('object_type', '=', 'service'),
|
||||||
|
Filter::expression('state', '=', '2'),
|
||||||
|
Filter::matchAny(
|
||||||
|
Filter::expression('type', '=', 'hard_state'),
|
||||||
|
Filter::expression('type', '=', 'hard_state')
|
||||||
|
)
|
||||||
|
);
|
||||||
$data[$day] = array(
|
$data[$day] = array(
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
'caption' => $caption,
|
'caption' => $caption,
|
||||||
'url' => $this->href(
|
'url' => $this->href('monitoring/list/eventhistory?' . $filter->toQueryString())
|
||||||
'monitoring/list/eventhistory',
|
|
||||||
array(
|
|
||||||
'timestamp<' => strtotime($day . ' 23:59:59'),
|
|
||||||
'timestamp>' => strtotime($day . ' 00:00:00'),
|
|
||||||
'object_type' => 'service',
|
|
||||||
'state' => '2',
|
|
||||||
'type' => '(hard_state|soft_state)'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$grid->setData($data);
|
$grid->setData($data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user