Skip to content

Commit 3a3203e

Browse files
committed
WIP
1 parent 524f3a1 commit 3a3203e

File tree

6 files changed

+5
-12
lines changed

6 files changed

+5
-12
lines changed

application/controllers/DowntimesController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function indexAction()
4343
$sortControl = $this->createSortControl(
4444
$downtimes,
4545
[
46-
'downtime.is_in_effect, downtime.start_time' => t('Is In Effect'),
46+
'downtime.is_in_effect desc, downtime.start_time desc' => t('Is In Effect'),
4747
'downtime.entry_time' => t('Entry Time'),
4848
'host.display_name, service.display_name' => t('Host'),
4949
'service.display_name, host.display_name' => t('Service'),

application/controllers/HistoryController.php

-4
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ public function indexAction()
8181
}
8282

8383
$this->filter($history, $filter);
84-
$history->getWith()['history.host']->setJoinType('LEFT');
85-
$history->getSelectBase()
86-
// Make sure we'll fetch service history entries only for services which still exist
87-
->where(['history.service_id IS NULL', 'history_service.id IS NOT NULL'], Sql::ANY);
8884

8985
yield $this->export($history);
9086

application/controllers/ServiceController.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ public function historyAction()
126126

127127
$history
128128
->getSelectBase()
129-
->where([
130-
'history.host_id = ?' => $this->service->host->id,
131-
'history.service_id = ?' => $this->service->id
132-
]);
129+
->where(['history.service_id = ?' => $this->service->id]);
133130

134131
$before = $this->params->shift('before', time());
135132
$url = Url::fromRequest()->setParams(clone $this->params);

library/Icingadb/Model/Downtime.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function getSearchColumns()
8787

8888
public function getDefaultSort()
8989
{
90-
return ['downtime.is_in_effect', 'downtime.start_time'];
90+
return ['downtime.is_in_effect desc', 'downtime.start_time desc'];
9191
}
9292

9393
public function createBehaviors(Behaviors $behaviors)

library/Icingadb/Model/Host.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public function createRelations(Relations $relations)
197197
$relations->belongsToMany('hostgroup', Hostgroup::class)
198198
->through(HostgroupMember::class);
199199

200-
$relations->hasOne('state', HostState::class)->setJoinType('LEFT');
200+
$relations->hasOne('state', HostState::class);
201201
$relations->hasMany('comment', Comment::class)->setJoinType('LEFT');
202202
$relations->hasMany('downtime', Downtime::class)->setJoinType('LEFT');
203203
$relations->hasMany('history', History::class);

library/Icingadb/Model/Service.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function createRelations(Relations $relations)
190190
$relations->belongsToMany('hostgroup', Hostgroup::class)
191191
->through(HostgroupMember::class);
192192

193-
$relations->hasOne('state', ServiceState::class)->setJoinType('LEFT');
193+
$relations->hasOne('state', ServiceState::class);
194194
$relations->hasMany('comment', Comment::class)->setJoinType('LEFT');
195195
$relations->hasMany('downtime', Downtime::class)->setJoinType('LEFT');
196196
$relations->hasMany('history', History::class);

0 commit comments

Comments
 (0)