From 3aa644a2e0c7cb520fc6abc32268c586efaddce8 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 13 Mar 2024 12:38:06 +0100 Subject: [PATCH 1/7] Fix hostname validation in validate-input.json --- imageroot/actions/configure-module/validate-input.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imageroot/actions/configure-module/validate-input.json b/imageroot/actions/configure-module/validate-input.json index ad396bb..28ec857 100644 --- a/imageroot/actions/configure-module/validate-input.json +++ b/imageroot/actions/configure-module/validate-input.json @@ -49,7 +49,8 @@ "host": { "type": "string", "description": "Host name for the wiki, like 'wiki.nethserver.org'", - "format": "idn-hostname" + "format": "hostname", + "pattern": "\\." }, "lets_encrypt": { "type": "boolean", From 908e675742cf6ddcf5f7d46044deefba0b45904a Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 13 Mar 2024 16:10:07 +0100 Subject: [PATCH 2/7] Add host_pattern validation message --- ui/public/i18n/en/translation.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/public/i18n/en/translation.json b/ui/public/i18n/en/translation.json index 8e5c630..0d9e098 100644 --- a/ui/public/i18n/en/translation.json +++ b/ui/public/i18n/en/translation.json @@ -30,6 +30,7 @@ "admin_email": "Administrator email address", "admin_full_name": "Administrator full name", "wiki_fqdn": "Wiki FQDN", + "host_pattern": "Must be a valid fully qualified domain name", "show_password": "Show password", "hide_password": "Hide password", "save": "Save", From bf9e47554c3a8e12872410b2fe64a0b48e1ea0f2 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 13 Mar 2024 16:18:51 +0100 Subject: [PATCH 3/7] Disable input fields if already set in Settings.vue --- ui/src/views/Settings.vue | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/ui/src/views/Settings.vue b/ui/src/views/Settings.vue index 14d6652..9d9f8c2 100644 --- a/ui/src/views/Settings.vue +++ b/ui/src/views/Settings.vue @@ -24,7 +24,7 @@ v-model.trim="wikiName" class="mg-bottom" :invalid-message="$t(error.wiki_name)" - :disabled="loading.getConfiguration || loading.configureModule" + :disabled="loading.getConfiguration || loading.configureModule || already_set" ref="wikiName" > @@ -33,7 +33,7 @@ v-model.trim="username" class="mg-bottom" :invalid-message="$t(error.username)" - :disabled="loading.getConfiguration || loading.configureModule" + :disabled="loading.getConfiguration || loading.configureModule || already_set" ref="username" > @@ -45,7 +45,7 @@ :password-hide-label="$t('settings.hide_password')" class="mg-bottom" :invalid-message="$t(error.password)" - :disabled="loading.getConfiguration || loading.configureModule" + :disabled="loading.getConfiguration || loading.configureModule || already_set" ref="password" > @@ -55,7 +55,7 @@ v-model.trim="email" class="mg-bottom" :invalid-message="$t(error.email)" - :disabled="loading.getConfiguration || loading.configureModule" + :disabled="loading.getConfiguration || loading.configureModule || already_set" ref="email" > @@ -64,7 +64,7 @@ v-model.trim="userFullName" class="mg-bottom" :invalid-message="$t(error.user_full_name)" - :disabled="loading.getConfiguration || loading.configureModule" + :disabled="loading.getConfiguration || loading.configureModule || already_set" ref="userFullName" > @@ -152,6 +152,7 @@ export default { page: "settings", }, urlCheckInterval: null, + already_set: false, wikiName: "", username: "", password: "", @@ -248,6 +249,17 @@ export default { this.isLetsEncryptEnabled = config.lets_encrypt; this.isHttpToHttpsEnabled = config.http2https; this.loading.getConfiguration = false; + // set already_set to true if the configuration is not empty + if ( + this.wikiName && + this.username && + this.password && + this.userFullName && + this.email + ) { + this.already_set = true; + } + this.focusElement("wikiName"); }, validateConfigureModule() { From 5d15fd8773de9ff72948b165587561f580f4c1da Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 13 Mar 2024 16:40:54 +0100 Subject: [PATCH 4/7] Add explanation where to configure when disabled --- ui/public/i18n/en/translation.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/public/i18n/en/translation.json b/ui/public/i18n/en/translation.json index 0d9e098..ca20c60 100644 --- a/ui/public/i18n/en/translation.json +++ b/ui/public/i18n/en/translation.json @@ -40,6 +40,8 @@ "disabled": "Disabled", "instance_configuration": "Configure {instance}", "configuring": "Configuring...", + "cannot_be_configured_again": "This instance cannot be configured anymore here", + "must_be_configured_inside_dokuwiki": "The admin user and settings must be configured inside DokuWiki", "email_format": "Invalid email address" }, "about": { From 464be9ca818718713ba497b17b0628e3b0cfd770 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 13 Mar 2024 16:40:58 +0100 Subject: [PATCH 5/7] Add inline notification for already configured settings --- ui/src/views/Settings.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/src/views/Settings.vue b/ui/src/views/Settings.vue index 9d9f8c2..f7ff6ad 100644 --- a/ui/src/views/Settings.vue +++ b/ui/src/views/Settings.vue @@ -15,6 +15,16 @@ /> +
+
+ +
+
From 0bd5fdc5706ca492794baf5377b77cde03dfd2c3 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 14 Mar 2024 11:00:57 +0100 Subject: [PATCH 6/7] Update Dokuwiki configuration messages and add link to Dokuwiki webapp --- ui/public/i18n/en/translation.json | 5 +++-- ui/src/views/Settings.vue | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/public/i18n/en/translation.json b/ui/public/i18n/en/translation.json index ca20c60..8e806e2 100644 --- a/ui/public/i18n/en/translation.json +++ b/ui/public/i18n/en/translation.json @@ -40,8 +40,9 @@ "disabled": "Disabled", "instance_configuration": "Configure {instance}", "configuring": "Configuring...", - "cannot_be_configured_again": "This instance cannot be configured anymore here", - "must_be_configured_inside_dokuwiki": "The admin user and settings must be configured inside DokuWiki", + "dokuwiki_note": "Note", + "must_be_configured_inside_dokuwiki": "You can configure only Dokuwiki FQDN in this page. To configure other setting go to dokuwiki", + "go_to_dokuwiki": "Go to Dokuwiki", "email_format": "Invalid email address" }, "about": { diff --git a/ui/src/views/Settings.vue b/ui/src/views/Settings.vue index f7ff6ad..7b1024e 100644 --- a/ui/src/views/Settings.vue +++ b/ui/src/views/Settings.vue @@ -19,9 +19,11 @@
@@ -206,6 +208,9 @@ export default { next(); }, methods: { + goToDokuwikiWebapp() { + window.open(`https://${this.host}`, "_blank"); + }, async getConfiguration() { this.loading.getConfiguration = true; this.error.getConfiguration = ""; From 0cefb1a6ba2c8858fe415067d32afa2ab2dde559 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 14 Mar 2024 11:51:05 +0100 Subject: [PATCH 7/7] Translation review of Andrea Co-authored-by: Andrea Leardini --- ui/public/i18n/en/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/public/i18n/en/translation.json b/ui/public/i18n/en/translation.json index 8e806e2..cad5318 100644 --- a/ui/public/i18n/en/translation.json +++ b/ui/public/i18n/en/translation.json @@ -41,7 +41,7 @@ "instance_configuration": "Configure {instance}", "configuring": "Configuring...", "dokuwiki_note": "Note", - "must_be_configured_inside_dokuwiki": "You can configure only Dokuwiki FQDN in this page. To configure other setting go to dokuwiki", + "must_be_configured_inside_dokuwiki": "You can configure only Dokuwiki FQDN in this page. To configure other setting go to Dokuwiki webapp", "go_to_dokuwiki": "Go to Dokuwiki", "email_format": "Invalid email address" },