From ad49a63eaee8eef1ede586ec85c33acc2f89583a Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 4 May 2022 15:35:48 +0200 Subject: [PATCH] use floating labels for installation, looks less confusing Signed-off-by: Michael Kaufmann --- lib/Froxlor/Install/Install/Core.php | 1 - lib/formfields/install/formfield.install.php | 59 ++++++++++++++------ lng/en.lng.php | 4 ++ templates/Froxlor/form/formfields.html.twig | 13 ++++- 4 files changed, 57 insertions(+), 20 deletions(-) diff --git a/lib/Froxlor/Install/Install/Core.php b/lib/Froxlor/Install/Install/Core.php index 446f0c0d..d89a312b 100644 --- a/lib/Froxlor/Install/Install/Core.php +++ b/lib/Froxlor/Install/Install/Core.php @@ -503,7 +503,6 @@ class Core ]); } - // last but not least create the main admin $ins_data = [ 'loginname' => $this->validatedData['admin_user'], diff --git a/lib/formfields/install/formfield.install.php b/lib/formfields/install/formfield.install.php index f3e006e9..a13f3260 100644 --- a/lib/formfields/install/formfield.install.php +++ b/lib/formfields/install/formfield.install.php @@ -35,40 +35,56 @@ return [ 'fields' => [ 'mysql_host' => [ 'label' => lng('mysql.mysql_server'), + 'placeholder' => lng('mysql.mysql_server'), 'type' => 'text', 'mandatory' => true, 'value' => old('mysql_host', 'localhost', 'installation') ], + 'mysql_ssl_ca_file' => [ + 'label' => lng('mysql.mysql_ssl_ca_file'), + 'placeholder' => lng('mysql.mysql_ssl_ca_file'), + 'type' => 'text', + 'value' => old('mysql_ssl_ca_file', null, 'installation'), + 'advanced' => true, // @todo + ], + 'mysql_ssl_verify_server_certificate' => [ + 'label' => lng('mysql.mysql_ssl_verify_server_certificate'), + 'type' => 'checkbox', + 'value' => '1', + 'checked' => old('mysql_ssl_verify_server_certificate', '0', 'installation'), + 'advanced' => true // @todo + ], 'mysql_root_user' => [ 'label' => lng('mysql.privileged_user'), + 'placeholder' => lng('mysql.privileged_user'), 'type' => 'text', 'mandatory' => true, 'value' => old('mysql_root_user', 'froxroot', 'installation'), - 'next_to' => [ - 'mysql_root_pass' => [ - 'label' => lng('login.password'), - 'type' => 'password', - 'mandatory' => true, - 'value' => old('mysql_root_pass', null, 'installation'), - ], - ] + ], + 'mysql_root_pass' => [ + 'label' => lng('mysql.privileged_passwd'), + 'placeholder' => lng('mysql.privileged_passwd'), + 'type' => 'password', + 'mandatory' => true, + 'value' => old('mysql_root_pass', null, 'installation'), ], 'mysql_unprivileged_user' => [ 'label' => lng('install.database.user'), + 'placeholder' => lng('install.database.user'), 'type' => 'text', 'mandatory' => true, 'value' => old('mysql_unprivileged_user', 'froxlor', 'installation'), - 'next_to' => [ - 'mysql_unprivileged_pass' => [ - 'label' => lng('login.password'), - 'type' => 'password', - 'mandatory' => true, - 'value' => old('mysql_unprivileged_pass', null, 'installation'), - ], - ] + ], + 'mysql_unprivileged_pass' => [ + 'label' => lng('mysql.unprivileged_passwd'), + 'placeholder' => lng('mysql.unprivileged_passwd'), + 'type' => 'password', + 'mandatory' => true, + 'value' => old('mysql_unprivileged_pass', null, 'installation'), ], 'mysql_database' => [ 'label' => lng('install.database.dbname'), + 'placeholder' => lng('install.database.dbname'), 'type' => 'text', 'mandatory' => true, 'value' => old('mysql_database', 'froxlor', 'installation'), @@ -87,30 +103,35 @@ return [ 'fields' => [ 'admin_name' => [ 'label' => lng('customer.name'), + 'placeholder' => lng('customer.name'), 'type' => 'text', 'mandatory' => true, 'value' => old('admin_name', 'Administrator', 'installation'), ], 'admin_user' => [ 'label' => lng('login.username'), + 'placeholder' => lng('login.username'), 'type' => 'text', 'mandatory' => true, 'value' => old('admin_user', 'admin', 'installation'), ], 'admin_pass' => [ 'label' => lng('login.password'), + 'placeholder' => lng('login.password'), 'type' => 'password', 'mandatory' => true, 'value' => old('admin_pass', null, 'installation'), ], 'admin_pass_confirm' => [ 'label' => lng('changepassword.new_password_confirm'), + 'placeholder' => lng('changepassword.new_password_confirm'), 'type' => 'password', 'mandatory' => true, 'value' => old('admin_pass_confirm', null, 'installation'), ], 'admin_email' => [ 'label' => lng('customer.email'), + 'placeholder' => lng('customer.email'), 'type' => 'text', 'mandatory' => true, 'value' => old('admin_email', null, 'installation'), @@ -129,12 +150,14 @@ return [ ], 'serverip' => [ 'label' => lng('serversettings.ipaddress.title'), + 'placeholder' => lng('serversettings.ipaddress.title'), 'type' => 'text', 'mandatory' => true, 'value' => old('serverip', null, 'installation'), ], 'servername' => [ 'label' => lng('install.system.servername'), + 'placeholder' => lng('install.system.servername'), 'type' => 'text', 'mandatory' => true, 'value' => old('servername', null, 'installation'), @@ -160,12 +183,14 @@ return [ ], 'httpuser' => [ 'label' => lng('admin.webserver_user'), + 'placeholder' => lng('admin.webserver_user'), 'type' => 'text', 'mandatory' => true, 'value' => old('httpuser', 'www-data', 'installation'), ], 'httpgroup' => [ 'label' => lng('admin.webserver_group'), + 'placeholder' => lng('admin.webserver_group'), 'type' => 'text', 'mandatory' => true, 'value' => old('httpgroup', 'www-data', 'installation'), @@ -185,7 +210,7 @@ return [ 'system' => [ 'label' => lng('install.install.runcmd'), 'type' => 'textarea', - 'value' => Froxlor::getInstallDir().'bin/froxlor-cli froxlor:config-services -a [JSON PARAMETER] --yes-to-all', + 'value' => Froxlor::getInstallDir() . 'bin/froxlor-cli froxlor:config-services -a [JSON PARAMETER] --yes-to-all', 'readonly' => true, 'rows' => 1 ], diff --git a/lng/en.lng.php b/lng/en.lng.php index f11ac827..1a6d35c2 100644 --- a/lng/en.lng.php +++ b/lng/en.lng.php @@ -1369,6 +1369,10 @@ Yours sincerely, your administrator', 'database_edit' => 'Edit database', 'size' => 'Size', 'privileged_user' => 'Privileged database user', + 'privileged_passwd' => 'Password for priviliged user', + 'unprivileged_passwd' => 'Password for unpriviliged user', + 'mysql_ssl_ca_file' => 'SSL server certificate', + 'mysql_ssl_verify_server_certificate' => 'Verify SSL server certificate' ], 'opcacheinfo' => [ 'generaltitle' => 'General Information', diff --git a/templates/Froxlor/form/formfields.html.twig b/templates/Froxlor/form/formfields.html.twig index 29dba964..318d8b8a 100644 --- a/templates/Froxlor/form/formfields.html.twig +++ b/templates/Froxlor/form/formfields.html.twig @@ -61,11 +61,20 @@ {% endif %} {% endmacro %} +{# installation specific format #} {% macro field(id, field, norow = true, nohide = false, em = false) %} -
- + {% if field.type != 'checkbox' %} +
{{ _self.fieldrow(id, field, norow, nohide, em) }} +
+ {% else %} +
+ + + +
+ {% endif %} {% endmacro %} {% macro bool(id, field) %}