IcingaHostForm: allow access to Zone and Agent...

...properties on every host

fixes #13965
This commit is contained in:
Thomas Gelf 2017-01-12 13:44:43 +01:00
parent 4767e1cdc7
commit 0e8674c872
2 changed files with 13 additions and 26 deletions

View File

@ -50,10 +50,6 @@ class IcingaHostForm extends DirectorObjectForm
*/
protected function addClusteringElements()
{
if (!$this->isTemplate() && !$this->hasClusterProperties()) {
return $this;
}
$this->addZoneElement();
$this->addBoolean('has_agent', array(
@ -81,16 +77,18 @@ class IcingaHostForm extends DirectorObjectForm
$this->addHidden('command_endpoint_id', null);
$this->setSentValue('command_endpoint_id', null);
} else {
$this->addElement('select', 'command_endpoint_id', array(
'label' => $this->translate('Command endpoint'),
'description' => $this->translate(
'Setting a command endpoint allows you to force host checks'
. ' to be executed by a specific endpoint. Please carefully'
. ' study the related Icinga documentation before using this'
. ' feature'
),
'multiOptions' => $this->optionalEnum($this->enumEndpoints())
));
if ($this->isTemplate()) {
$this->addElement('select', 'command_endpoint_id', array(
'label' => $this->translate('Command endpoint'),
'description' => $this->translate(
'Setting a command endpoint allows you to force host checks'
. ' to be executed by a specific endpoint. Please carefully'
. ' study the related Icinga documentation before using this'
. ' feature'
),
'multiOptions' => $this->optionalEnum($this->enumEndpoints())
));
}
foreach (array('master_should_connect', 'accept_config') as $key) {
$this->addHidden($key, null);
@ -118,15 +116,6 @@ class IcingaHostForm extends DirectorObjectForm
return $this;
}
protected function hasClusterProperties()
{
if (!$object = $this->object) {
return false;
}
return $object->get('zone_id') || $object->get('has_agent') === 'y';
}
protected function beforeSuccessfulRedirect()
{
if ($this->allowsExperimental() && $this->getSentValue('create_live') === 'y') {

View File

@ -72,9 +72,7 @@ Zone membership handling
Mostly you do not need to care much about Zones when working with the
Director. In case you have no Satellite node, you wouldn't even notice
their existence. When running Satellites, the way to go is to create
dedicated templates for your zones. Usually this requires one template
per Satellite zone.
their existence.
You are not required to deal with Agent Zones, as the Director does
this for you. Please refer to [Working with agents](24-Working-with-agents.md)