summaryrefslogtreecommitdiffstats
path: root/application/forms/IcingaEndpointForm.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:31 +0000
commitf66ab8dae2f3d0418759f81a3a64dc9517a62449 (patch)
treefbff2135e7013f196b891bbde54618eb050e4aaf /application/forms/IcingaEndpointForm.php
parentInitial commit. (diff)
downloadicingaweb2-module-director-f66ab8dae2f3d0418759f81a3a64dc9517a62449.tar.xz
icingaweb2-module-director-f66ab8dae2f3d0418759f81a3a64dc9517a62449.zip
Adding upstream version 1.10.2.upstream/1.10.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/forms/IcingaEndpointForm.php')
-rw-r--r--application/forms/IcingaEndpointForm.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/application/forms/IcingaEndpointForm.php b/application/forms/IcingaEndpointForm.php
new file mode 100644
index 0000000..1c08cb4
--- /dev/null
+++ b/application/forms/IcingaEndpointForm.php
@@ -0,0 +1,61 @@
+<?php
+
+namespace Icinga\Module\Director\Forms;
+
+use Icinga\Module\Director\Web\Form\DirectorObjectForm;
+
+class IcingaEndpointForm extends DirectorObjectForm
+{
+ public function setup()
+ {
+ $this->addObjectTypeElement();
+ if (! $this->hasObjectType()) {
+ return;
+ }
+
+ if ($this->isTemplate()) {
+ $this->addElement('text', 'object_name', array(
+ 'label' => $this->translate('Endpoint template name'),
+ 'required' => true,
+ 'description' => $this->translate('Name for the Icinga endpoint template you are going to create')
+ ));
+ } else {
+ $this->addElement('text', 'object_name', array(
+ 'label' => $this->translate('Endpoint'),
+ 'required' => true,
+ 'description' => $this->translate('Name for the Icinga endpoint you are going to create')
+ ));
+ }
+
+ $this->addElement('text', 'host', array(
+ 'label' => $this->translate('Endpoint address'),
+ 'description' => $this->translate('IP address / hostname of remote node')
+ ));
+
+ $this->addElement('text', 'port', array(
+ 'label' => $this->translate('Port'),
+ 'description' => $this->translate('The port of the endpoint.'),
+ ));
+
+ $this->addElement('text', 'log_duration', array(
+ 'label' => $this->translate('Log Duration'),
+ 'description' => $this->translate('The log duration time.')
+ ));
+
+ $this->addElement('select', 'apiuser_id', array(
+ 'label' => $this->translate('API user'),
+ 'multiOptions' => $this->optionalEnum($this->db->enumApiUsers())
+ ));
+
+ $this->addZoneElement();
+
+ if ($this->object->hasBeenLoadedFromDb()) {
+ $imports = $this->object->get('imports');
+ if ($imports !== null && count($imports) > 0) {
+ $this->addImportsElement(false);
+ }
+ }
+
+ $this->setButtons();
+ }
+}