mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 18:59:05 +02:00
ObjectsTableService: show Service objects without
...Host and highlight them as errors
This commit is contained in:
parent
13f33a842b
commit
7815e450b7
@ -4,6 +4,7 @@ namespace Icinga\Module\Director\Web\Table;
|
|||||||
|
|
||||||
use Icinga\Module\Director\Db\IcingaObjectFilterHelper;
|
use Icinga\Module\Director\Db\IcingaObjectFilterHelper;
|
||||||
use Icinga\Module\Director\Objects\IcingaService;
|
use Icinga\Module\Director\Objects\IcingaService;
|
||||||
|
use ipl\Html\Html;
|
||||||
use ipl\Web\Table\Extension\MultiSelect;
|
use ipl\Web\Table\Extension\MultiSelect;
|
||||||
use ipl\Html\Link;
|
use ipl\Html\Link;
|
||||||
use ipl\Web\Url;
|
use ipl\Web\Url;
|
||||||
@ -55,8 +56,13 @@ class ObjectsTableService extends ObjectsTable
|
|||||||
'id' => $row->id,
|
'id' => $row->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$hostField = static::td(
|
||||||
|
Link::create($row->host === null ? Html::span(['class' => 'error'], '- none -') : $row->host, $url));
|
||||||
|
if ($row->host === null) {
|
||||||
|
$hostField->attributes()->add('class', 'error');
|
||||||
|
}
|
||||||
$tr = static::tr([
|
$tr = static::tr([
|
||||||
static::td(Link::create($row->host, $url)),
|
$hostField,
|
||||||
static::td($row->object_name)
|
static::td($row->object_name)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -68,7 +74,7 @@ class ObjectsTableService extends ObjectsTable
|
|||||||
|
|
||||||
public function prepareQuery()
|
public function prepareQuery()
|
||||||
{
|
{
|
||||||
return parent::prepareQuery()->join(
|
return parent::prepareQuery()->joinLeft(
|
||||||
['h' => 'icinga_host'],
|
['h' => 'icinga_host'],
|
||||||
"o.host_id = h.id AND h.object_type = 'object'",
|
"o.host_id = h.id AND h.object_type = 'object'",
|
||||||
[]
|
[]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user