IcingaZone: render endpoints
This commit is contained in:
parent
9c5776bf00
commit
1116bc4331
|
@ -818,6 +818,11 @@ return '';
|
|||
return $this->renderZoneProperty($this->zone_id);
|
||||
}
|
||||
|
||||
protected function renderCustomExtensions()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function renderObjectHeader()
|
||||
{
|
||||
return sprintf(
|
||||
|
@ -837,6 +842,7 @@ return '';
|
|||
$this->renderRanges(),
|
||||
$this->renderArguments(),
|
||||
$this->renderGroups(),
|
||||
$this->renderCustomExtensions(),
|
||||
$this->renderCustomVars(),
|
||||
$this->renderSuffix()
|
||||
));
|
||||
|
|
|
@ -27,6 +27,28 @@ class IcingaZone extends IcingaObject
|
|||
|
||||
protected $supportsImports = true;
|
||||
|
||||
protected function renderCustomExtensions()
|
||||
{
|
||||
$endpoints = $this->listEndpoints();
|
||||
if (empty($endpoints)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return c::renderKeyValue('endpoints', c::renderArray($endpoints));
|
||||
}
|
||||
|
||||
// TODO: Move this away, should be prefetchable:
|
||||
protected function listEndpoints()
|
||||
{
|
||||
$db = $this->getDb();
|
||||
$query = $db->select()
|
||||
->from('icinga_endpoint', 'object_name')
|
||||
->where('zone_id = ?', $this->id)
|
||||
->order('object_name');
|
||||
|
||||
return $db->fetchCol($query);
|
||||
}
|
||||
|
||||
protected function renderParent_zone_id()
|
||||
{
|
||||
return $this->renderRelationProperty(
|
||||
|
|
Loading…
Reference in New Issue