Strikethrough deactivated services in applied service set

This commit is contained in:
raviks789 2023-06-14 14:51:38 +02:00 committed by Thomas Gelf
parent 8e60e0aab9
commit df08e91bc9

View File

@ -194,7 +194,18 @@ class IcingaServiceSetServiceTable extends ZfQueryBasedTable
$connection = $this->connection();
assert($connection instanceof Db);
$builder = new ServiceSetQueryBuilder($connection, $this->branchUuid);
return $builder->selectServicesForSet($this->set)->limit(100);
$query = $builder->selectServicesForSet($this->set);
if ($hostId = $this->affectedHost->get('id') !== null) {
$query->joinLeft(
['hsb' => 'icinga_host_service_blacklist'],
$this->db()->quoteInto('o.id = hsb.service_id AND hsb.host_id = ?', $hostId),
[]
)->columns([
'blacklisted' => "CASE WHEN hsb.service_id IS NULL THEN 'n' ELSE 'y' END"
]);
}
return $query->limit(100);
}
protected function createFakeRemoveLinkForReadonlyView()