Skip to content

Commit e5cef37

Browse files
committed
WIP
1 parent 148eb08 commit e5cef37

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

application/controllers/HistoryController.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function indexAction()
3737
'acknowledgement',
3838
'state'
3939
]);
40+
$history->disableDefaultSort();
4041

4142
$before = $this->params->shift('before', time());
4243
$url = Url::fromPath('icingadb/history')->setParams(clone $this->params);
@@ -76,7 +77,10 @@ public function indexAction()
7677
$history->limit($page * $limitControl->getLimit());
7778
}
7879

79-
$history->filter(Filter::lessThanOrEqual('event_time', $before));
80+
if ($this->params->has('before')) {
81+
$history->filter(Filter::lessThanOrEqual('event_time', $before));
82+
}
83+
8084
$this->filter($history, $filter);
8185
$history->getWith()['history.host']->setJoinType('LEFT');
8286
$history->getSelectBase()

library/Icingadb/Model/History.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function createRelations(Relations $relations)
8080
{
8181
$relations->belongsTo('endpoint', Endpoint::class);
8282
$relations->belongsTo('environment', Environment::class);
83-
$relations->belongsTo('host', Host::class);
83+
$relations->belongsTo('host', Host::class)->setJoinType('LEFT');
8484
$relations->belongsTo('service', Service::class)->setJoinType('LEFT');
8585

8686
$relations->hasOne('comment', CommentHistory::class)

0 commit comments

Comments
 (0)