mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 17:24:18 +02:00
parent
7b9e9f3a2f
commit
cd9d93de3e
@ -417,13 +417,38 @@ class ActivityLogInfo extends HtmlDocument
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function objectToConfig(IcingaObject $object)
|
||||||
|
{
|
||||||
|
if ($object instanceof IcingaService) {
|
||||||
|
return $this->previewService($object);
|
||||||
|
} else {
|
||||||
|
return $object->toSingleIcingaConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function previewService(IcingaService $service)
|
||||||
|
{
|
||||||
|
if (($set = $service->get('service_set')) !== null) {
|
||||||
|
// simulate rendering of service in set
|
||||||
|
$set = IcingaServiceSet::load($set, $this->db);
|
||||||
|
|
||||||
|
$service->set('service_set_id', null);
|
||||||
|
if (($assign = $set->get('assign_filter')) !== null) {
|
||||||
|
$service->set('object_type', 'apply');
|
||||||
|
$service->set('assign_filter', $assign);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $service->toSingleIcingaConfig();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return IcingaConfig
|
* @return IcingaConfig
|
||||||
* @throws \Icinga\Exception\IcingaException
|
* @throws \Icinga\Exception\IcingaException
|
||||||
*/
|
*/
|
||||||
protected function newConfig()
|
protected function newConfig()
|
||||||
{
|
{
|
||||||
return $this->newObject()->toSingleIcingaConfig();
|
return $this->objectToConfig($this->newObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -432,7 +457,7 @@ class ActivityLogInfo extends HtmlDocument
|
|||||||
*/
|
*/
|
||||||
protected function oldConfig()
|
protected function oldConfig()
|
||||||
{
|
{
|
||||||
return $this->oldObject()->toSingleIcingaConfig();
|
return $this->objectToConfig($this->oldObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getLinkToObject()
|
protected function getLinkToObject()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user