IcingaHostForm: allow to set api_key for templates

refs #486
This commit is contained in:
Thomas Gelf 2017-07-06 15:10:00 +02:00
parent 475c84de1e
commit 6b10cdc3f7

View File

@ -64,6 +64,17 @@ class IcingaHostForm extends DirectorObjectForm
'class' => 'autosubmit',
));
if ($this->isTemplate() && $this->object()->getShortTableName() === 'host') {
$this->addElement('text', 'api_key', array(
'label' => $this->translate('API key'),
'description' => $this->translate(
'This key (16-32 characters long) allows one to deploy new'
. ' hosts for this template through the REST API without'
. ' authentication.'
),
));
}
if ($this->getSentOrResolvedObjectValue('has_agent') === 'y') {
$this->addBoolean('master_should_connect', array(
'label' => $this->translate('Establish connection'),
@ -106,6 +117,7 @@ class IcingaHostForm extends DirectorObjectForm
'master_should_connect',
'accept_config',
'command_endpoint_id',
'api_key',
);
$this->addDisplayGroup($elements, 'clustering', array(
'decorators' => array(