mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-27 07:44:05 +02:00
IcingaHostForm: allow to select non-global zones
This commit is contained in:
parent
269ae11ec4
commit
3fade17bf4
@ -30,6 +30,7 @@ class IcingaHostForm extends DirectorObjectForm
|
||||
'description' => $this->translate('Usually your hosts main IPv6 address')
|
||||
));
|
||||
|
||||
$this->addZoneElement();
|
||||
$this->addImportsElement();
|
||||
|
||||
/*
|
||||
@ -44,6 +45,7 @@ class IcingaHostForm extends DirectorObjectForm
|
||||
'display_name',
|
||||
'address',
|
||||
'address6',
|
||||
'zone_id',
|
||||
'imports',
|
||||
);
|
||||
$this->addDisplayGroup($elements, 'object_definition', array(
|
||||
@ -61,8 +63,7 @@ class IcingaHostForm extends DirectorObjectForm
|
||||
} else {
|
||||
$this->getElement('imports')->setRequired();
|
||||
}
|
||||
$this->setButtons();
|
||||
|
||||
// $this->addZoneElement();
|
||||
$this->setButtons();
|
||||
}
|
||||
}
|
||||
|
@ -334,6 +334,12 @@ class Db extends DbConnection
|
||||
return $this->enumIcingaObjects('zone');
|
||||
}
|
||||
|
||||
public function enumNonglobalZones()
|
||||
{
|
||||
$filters = array('is_global = ?' => 'n');
|
||||
return $this->enumIcingaObjects('zone', $filters);
|
||||
}
|
||||
|
||||
public function enumZoneTemplates()
|
||||
{
|
||||
return $this->enumIcingaTemplates('zone');
|
||||
|
@ -742,7 +742,7 @@ abstract class DirectorObjectForm extends QuickForm
|
||||
$this->addElement('select', 'zone_id', array(
|
||||
'label' => $this->translate('Cluster Zone'),
|
||||
'description' => $this->translate('Icinga cluster zone'),
|
||||
'multiOptions' => $this->optionalEnum($this->db->enumZones())
|
||||
'multiOptions' => $this->optionalEnum($this->db->enumNonglobalZones())
|
||||
));
|
||||
|
||||
return $this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user