mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
IcingaHostForm: allow access to Zone and Agent...
...properties on every host fixes #13965
This commit is contained in:
parent
4767e1cdc7
commit
0e8674c872
@ -50,10 +50,6 @@ class IcingaHostForm extends DirectorObjectForm
|
|||||||
*/
|
*/
|
||||||
protected function addClusteringElements()
|
protected function addClusteringElements()
|
||||||
{
|
{
|
||||||
if (!$this->isTemplate() && !$this->hasClusterProperties()) {
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->addZoneElement();
|
$this->addZoneElement();
|
||||||
|
|
||||||
$this->addBoolean('has_agent', array(
|
$this->addBoolean('has_agent', array(
|
||||||
@ -81,16 +77,18 @@ class IcingaHostForm extends DirectorObjectForm
|
|||||||
$this->addHidden('command_endpoint_id', null);
|
$this->addHidden('command_endpoint_id', null);
|
||||||
$this->setSentValue('command_endpoint_id', null);
|
$this->setSentValue('command_endpoint_id', null);
|
||||||
} else {
|
} else {
|
||||||
$this->addElement('select', 'command_endpoint_id', array(
|
if ($this->isTemplate()) {
|
||||||
'label' => $this->translate('Command endpoint'),
|
$this->addElement('select', 'command_endpoint_id', array(
|
||||||
'description' => $this->translate(
|
'label' => $this->translate('Command endpoint'),
|
||||||
'Setting a command endpoint allows you to force host checks'
|
'description' => $this->translate(
|
||||||
. ' to be executed by a specific endpoint. Please carefully'
|
'Setting a command endpoint allows you to force host checks'
|
||||||
. ' study the related Icinga documentation before using this'
|
. ' to be executed by a specific endpoint. Please carefully'
|
||||||
. ' feature'
|
. ' study the related Icinga documentation before using this'
|
||||||
),
|
. ' feature'
|
||||||
'multiOptions' => $this->optionalEnum($this->enumEndpoints())
|
),
|
||||||
));
|
'multiOptions' => $this->optionalEnum($this->enumEndpoints())
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
foreach (array('master_should_connect', 'accept_config') as $key) {
|
foreach (array('master_should_connect', 'accept_config') as $key) {
|
||||||
$this->addHidden($key, null);
|
$this->addHidden($key, null);
|
||||||
@ -118,15 +116,6 @@ class IcingaHostForm extends DirectorObjectForm
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function hasClusterProperties()
|
|
||||||
{
|
|
||||||
if (!$object = $this->object) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $object->get('zone_id') || $object->get('has_agent') === 'y';
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function beforeSuccessfulRedirect()
|
protected function beforeSuccessfulRedirect()
|
||||||
{
|
{
|
||||||
if ($this->allowsExperimental() && $this->getSentValue('create_live') === 'y') {
|
if ($this->allowsExperimental() && $this->getSentValue('create_live') === 'y') {
|
||||||
|
@ -72,9 +72,7 @@ Zone membership handling
|
|||||||
|
|
||||||
Mostly you do not need to care much about Zones when working with the
|
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
|
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
|
their existence.
|
||||||
dedicated templates for your zones. Usually this requires one template
|
|
||||||
per Satellite zone.
|
|
||||||
|
|
||||||
You are not required to deal with Agent Zones, as the Director does
|
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)
|
this for you. Please refer to [Working with agents](24-Working-with-agents.md)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user