From fb38e0e21d29aba6dadda15482abb80ea1fce184 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Fri, 13 May 2022 15:15:20 +0200 Subject: [PATCH] add basic/advanced switcher for installation-mode Signed-off-by: Michael Kaufmann --- lng/en.lng.php | 2 ++ templates/Froxlor/install/index.html.twig | 12 +++++++++++- templates/Froxlor/src/js/components/install.js | 17 +++++++++++++++++ templates/Froxlor/src/js/main.js | 1 + 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 templates/Froxlor/src/js/components/install.js diff --git a/lng/en.lng.php b/lng/en.lng.php index 98c513de..c39eb24c 100644 --- a/lng/en.lng.php +++ b/lng/en.lng.php @@ -2469,6 +2469,8 @@ Yours sincerely, your administrator', 'phpinfoupdate' => 'Update your current PHP Version from %s to %s or higher', 'start_installation' => 'Start installation', 'check_again' => 'Reload to check again', + 'switchmode_advanced' => 'Show advanced options', + 'switchmode_basic' => 'Hide advanced options', 'dependency_check' => [ 'title' => 'Welcome to froxlor', 'description' => 'We check the system for dependencies to ensure that all required php extensions and modules are enabled so that froxlor runs properly.', diff --git a/templates/Froxlor/install/index.html.twig b/templates/Froxlor/install/index.html.twig index 688ac07a..1fb10084 100644 --- a/templates/Froxlor/install/index.html.twig +++ b/templates/Froxlor/install/index.html.twig @@ -35,7 +35,17 @@
{% if setup.step > 0 %} -

{{ section.title }}

+
+
+

{{ section.title }}

+
+
+
+ + +
+
+

{{ section.description }}


diff --git a/templates/Froxlor/src/js/components/install.js b/templates/Froxlor/src/js/components/install.js new file mode 100644 index 00000000..9c29a4a1 --- /dev/null +++ b/templates/Froxlor/src/js/components/install.js @@ -0,0 +1,17 @@ +$(function () { + /* + * switch between basic and advanced install mode + */ + $('#switchInstallMode').on('click', function () { + var checked = $(this).prop('checked'); + window.location = '/install/install.php' + replaceQueryParam('extended', +checked, window.location.search); + }); + + function replaceQueryParam(param, newval, search) { + var regex = new RegExp("([?;&])" + param + "[^&;]*[;&]?"); + if (search.match(regex)) { + search = search.replace(regex, "$1").replace(/&$/, ''); + } + return search + '&' + param + '=' + newval; + } +}); diff --git a/templates/Froxlor/src/js/main.js b/templates/Froxlor/src/js/main.js index 27c7e48c..ed895581 100644 --- a/templates/Froxlor/src/js/main.js +++ b/templates/Froxlor/src/js/main.js @@ -21,3 +21,4 @@ require('./components/ipsandports') require('./components/domains') require('./components/configfiles') require('./components/apikeys') +require('./components/install')