[icinga-checkins] icinga.org: icingaweb2-module-director/feature/experimental-to-bool-12970: Settings: show experimental_features as a boolean

git at icinga.org git at icinga.org
Tue Oct 25 00:01:24 CEST 2016


Module: icingaweb2-module-director
Branch: feature/experimental-to-bool-12970
Commit: 556265d134ec13f052a55fcef834396946093fcc
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=556265d134ec13f052a55fcef834396946093fcc

Author: Thomas Gelf <thomas at gelf.net>
Date:   Mon Oct 24 21:04:46 2016 +0000

Settings: show experimental_features as a boolean

---

 application/forms/SettingsForm.php               |   15 +++++++++++++++
 library/Director/Settings.php                    |    2 +-
 library/Director/Web/Form/DirectorObjectForm.php |    2 +-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/application/forms/SettingsForm.php b/application/forms/SettingsForm.php
index af94274..0941aa0 100644
--- a/application/forms/SettingsForm.php
+++ b/application/forms/SettingsForm.php
@@ -76,6 +76,21 @@ class SettingsForm extends QuickForm
             ),
         ));
 
+        $this->addElement('select', 'experimental_features', array(
+            'label'        => $this->translate('Enable experimental features'),
+            'multiOptions' => $this->eventuallyConfiguredEnum(
+                'experimental_features',
+                array(
+                    'n' => $this->translate('No'),
+                    'y' => $this->translate('Yes'),
+                )
+            ),
+            'description'  => $this->translate(
+                'Allow experimental features. NO, it is NOT a good idea to use'
+                . ' this. You\'ll break your monitoring and nobody will help you'
+            ),
+        ));
+
         $this->getElement('config_format')->setValue(
             $settings->getStoredValue('config_format')
         );
diff --git a/library/Director/Settings.php b/library/Director/Settings.php
index 214b248..e620fb1 100644
--- a/library/Director/Settings.php
+++ b/library/Director/Settings.php
@@ -17,7 +17,7 @@ class Settings
         'override_services_varname'      => '_override_servicevars',
         'override_services_templatename' => 'host var overrides (Director)',
         'disable_all_jobs'               => 'n', // 'y'
-        // 'experimental_features'       => null, // 'allow'
+        'experimental_features'          => 'n', // 'y'
         // 'master_zone'                 => null,
     );
 
diff --git a/library/Director/Web/Form/DirectorObjectForm.php b/library/Director/Web/Form/DirectorObjectForm.php
index aaa81d7..a8fb601 100644
--- a/library/Director/Web/Form/DirectorObjectForm.php
+++ b/library/Director/Web/Form/DirectorObjectForm.php
@@ -1178,7 +1178,7 @@ abstract class DirectorObjectForm extends QuickForm
         if ($this->allowsExperimental === null) {
             $this->allowsExperimental = $this->db->settings()->get(
                 'experimental_features'
-            ) === 'allow';
+            ) === 'y';
         }
 
         return $this->allowsExperimental;



More information about the icinga-checkins mailing list