mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 17:24:18 +02:00
SettingsForm: more comfort for v1 users
This commit is contained in:
parent
003a100b9c
commit
f67b71a353
@ -92,28 +92,35 @@ class SettingsForm extends QuickForm
|
|||||||
. ' unsupported. There are no plans to make Director a first-'
|
. ' unsupported. There are no plans to make Director a first-'
|
||||||
. 'class configuration backends for Icinga 1.x'
|
. 'class configuration backends for Icinga 1.x'
|
||||||
),
|
),
|
||||||
|
'class' => 'autosubmit',
|
||||||
'value' => $settings->getStoredValue('config_format')
|
'value' => $settings->getStoredValue('config_format')
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($settings->getStoredValue('config_format') === 'v1') {
|
$this->setSubmitLabel($this->translate('Store'));
|
||||||
$this->addElement('select', 'deployment_mode_v1', array(
|
|
||||||
'label' => $this->translate('Deployment mode'),
|
|
||||||
'multiOptions' => $this->eventuallyConfiguredEnum(
|
|
||||||
'deployment_mode_v1',
|
|
||||||
array(
|
|
||||||
'active-passive' => $this->translate('Active-Passive'),
|
|
||||||
'masterless' => $this->translate('Master-less'),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'description' => $this->translate(
|
|
||||||
'Deployment mode for Icinga 1 configuration'
|
|
||||||
),
|
|
||||||
'value' => $settings->getStoredValue('deployment_mode_v1')
|
|
||||||
));
|
|
||||||
|
|
||||||
|
if ($this->hasBeenSent()) {
|
||||||
|
if ($this->getSentValue('config_format') !== 'v1') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} elseif ($settings->getStoredValue('config_format') !== 'v1') {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setSubmitLabel($this->translate('Store'));
|
$this->addElement('select', 'deployment_mode_v1', array(
|
||||||
|
'label' => $this->translate('Deployment mode'),
|
||||||
|
'multiOptions' => $this->eventuallyConfiguredEnum(
|
||||||
|
'deployment_mode_v1',
|
||||||
|
array(
|
||||||
|
'active-passive' => $this->translate('Active-Passive'),
|
||||||
|
'masterless' => $this->translate('Master-less'),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'description' => $this->translate(
|
||||||
|
'Deployment mode for Icinga 1 configuration'
|
||||||
|
),
|
||||||
|
'value' => $settings->getStoredValue('deployment_mode_v1')
|
||||||
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function eventuallyConfiguredEnum($name, $enum)
|
protected function eventuallyConfiguredEnum($name, $enum)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user