mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
IcingaServiceForm: cleanup, no details without type
This commit is contained in:
parent
c8a95f1de6
commit
a42be2a6e8
@ -10,6 +10,7 @@ class IcingaServiceForm extends DirectorObjectForm
|
|||||||
{
|
{
|
||||||
$this->addObjectTypeElement();
|
$this->addObjectTypeElement();
|
||||||
if (! $this->hasObjectType()) {
|
if (! $this->hasObjectType()) {
|
||||||
|
$this->groupObjectDefinition();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,39 +30,24 @@ class IcingaServiceForm extends DirectorObjectForm
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addElement('extensibleSet', 'groups', array(
|
$groups = $this->enumServicegroups();
|
||||||
'label' => $this->translate('Groups'),
|
if (! empty($groups)) {
|
||||||
'multiOptions' => $this->optionallyAddFromEnum($this->enumServicegroups()),
|
$this->addElement('extensibleSet', 'groups', array(
|
||||||
'positional' => false,
|
'label' => $this->translate('Groups'),
|
||||||
'description' => $this->translate(
|
'multiOptions' => $this->optionallyAddFromEnum($groups),
|
||||||
'Service groups that should be directly assigned to this service. Servicegroups can be useful'
|
'positional' => false,
|
||||||
. ' for various reasons. They are helpful to provided service-type specific view in Icinga Web 2,'
|
'description' => $this->translate(
|
||||||
. ' either for custom dashboards or as an instrument to enforce restrictior. Service groups'
|
'Service groups that should be directly assigned to this service. Servicegroups can be useful'
|
||||||
. ' can be directly assigned to single services or to service templates.'
|
. ' for various reasons. They are helpful to provided service-type specific view in Icinga Web 2,'
|
||||||
)
|
. ' either for custom dashboards or as an instrument to enforce restrictior. Service groups'
|
||||||
));
|
. ' can be directly assigned to single services or to service templates.'
|
||||||
|
)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
$this->addImportsElement();
|
$this->addImportsElement();
|
||||||
$this->addDisabledElement();
|
$this->addDisabledElement();
|
||||||
|
$this->groupObjectDefinition();
|
||||||
$elements = array(
|
|
||||||
'object_type',
|
|
||||||
'object_name',
|
|
||||||
'display_name',
|
|
||||||
'imports',
|
|
||||||
'host_id',
|
|
||||||
'groups',
|
|
||||||
'disabled',
|
|
||||||
);
|
|
||||||
$this->addDisplayGroup($elements, 'object_definition', array(
|
|
||||||
'decorators' => array(
|
|
||||||
'FormElements',
|
|
||||||
array('HtmlTag', array('tag' => 'dl')),
|
|
||||||
'Fieldset',
|
|
||||||
),
|
|
||||||
'order' => 20,
|
|
||||||
'legend' => $this->translate('Service properties')
|
|
||||||
));
|
|
||||||
|
|
||||||
$this->addCheckCommandElements();
|
$this->addCheckCommandElements();
|
||||||
|
|
||||||
@ -96,6 +82,29 @@ class IcingaServiceForm extends DirectorObjectForm
|
|||||||
$this->setButtons();
|
$this->setButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected function groupObjectDefinition()
|
||||||
|
{
|
||||||
|
$elements = array(
|
||||||
|
'object_type',
|
||||||
|
'object_name',
|
||||||
|
'display_name',
|
||||||
|
'imports',
|
||||||
|
'host_id',
|
||||||
|
'groups',
|
||||||
|
'disabled',
|
||||||
|
);
|
||||||
|
$this->addDisplayGroup($elements, 'object_definition', array(
|
||||||
|
'decorators' => array(
|
||||||
|
'FormElements',
|
||||||
|
array('HtmlTag', array('tag' => 'dl')),
|
||||||
|
'Fieldset',
|
||||||
|
),
|
||||||
|
'order' => 20,
|
||||||
|
'legend' => $this->translate('Service properties')
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
protected function enumHostsAndTemplates()
|
protected function enumHostsAndTemplates()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user