summaryrefslogtreecommitdiffstats
path: root/application/forms/Config/BackendForm.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/forms/Config/BackendForm.php')
-rw-r--r--application/forms/Config/BackendForm.php59
1 files changed, 59 insertions, 0 deletions
diff --git a/application/forms/Config/BackendForm.php b/application/forms/Config/BackendForm.php
new file mode 100644
index 0000000..90e0af2
--- /dev/null
+++ b/application/forms/Config/BackendForm.php
@@ -0,0 +1,59 @@
+<?php
+
+namespace Icinga\Module\Graphite\Forms\Config;
+
+use Icinga\Forms\ConfigForm;
+use Icinga\Module\Graphite\Web\Form\Validator\HttpUserValidator;
+
+class BackendForm extends ConfigForm
+{
+ public function init()
+ {
+ $this->setName('form_config_graphite_backend');
+ $this->setSubmitLabel($this->translate('Save Changes'));
+ }
+
+ public function createElements(array $formData)
+ {
+ $this->addElements([
+ [
+ 'text',
+ 'graphite_url',
+ [
+ 'required' => true,
+ 'label' => $this->translate('Graphite Web URL'),
+ 'description' => $this->translate('URL to your Graphite Web'),
+ 'validators' => ['UrlValidator']
+ ]
+ ],
+ [
+ 'text',
+ 'graphite_user',
+ [
+ 'label' => $this->translate('Graphite Web user'),
+ 'description' => $this->translate(
+ 'A user with access to your Graphite Web via HTTP basic authentication'
+ ),
+ 'validators' => [new HttpUserValidator()]
+ ]
+ ],
+ [
+ 'password',
+ 'graphite_password',
+ [
+ 'renderPassword' => true,
+ 'label' => $this->translate('Graphite Web password'),
+ 'description' => $this->translate('The above user\'s password')
+ ]
+ ],
+ [
+ 'checkbox',
+ 'graphite_insecure',
+ [
+ 'label' => $this->translate('Connect insecurely'),
+ 'description' => $this->translate('Check this to not verify the remote\'s TLS certificate')
+ ]
+ ]
+ ]);
+ }
+}