Skip to content

Commit

Permalink
Merge pull request #22 from NethServer/dev6894
Browse files Browse the repository at this point in the history
Fix UI of dokuwiki (hostname and first configuration only)    NethServer/dev#6894
  • Loading branch information
stephdl authored Mar 14, 2024
2 parents 96c28ea + 7a40a1b commit 1d2a535
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
4 changes: 4 additions & 0 deletions ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,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",
Expand All @@ -43,6 +44,9 @@
"disabled": "Disabled",
"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 webapp",
"go_to_dokuwiki": "Go to Dokuwiki",
"email_format": "Invalid email address",
"host_pattern": "Must be a valid fully qualified domain name",
"host_format": "Must be a valid fully qualified domain name"
Expand Down
37 changes: 32 additions & 5 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
/>
</div>
</div>
<div v-if="already_set" class="bx--row">
<div class="bx--col">
<NsInlineNotification
kind="info"
:title="$t('settings.dokuwiki_note')"
:description="$t('settings.must_be_configured_inside_dokuwiki')"
:showCloseButton="false"
@click="goToDokuwikiWebapp"
:actionLabel="$t('settings.go_to_dokuwiki')"
/>
</div>
</div>
<div class="bx--row">
<div class="bx--col-lg-16">
<cv-tile :light="true">
Expand All @@ -24,7 +36,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"
>
</cv-text-input>
Expand All @@ -33,7 +45,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"
>
</cv-text-input>
Expand All @@ -45,7 +57,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"
>
</cv-text-input>
Expand All @@ -55,7 +67,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"
>
</cv-text-input>
Expand All @@ -64,7 +76,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"
>
</cv-text-input>
Expand Down Expand Up @@ -152,6 +164,7 @@ export default {
page: "settings",
},
urlCheckInterval: null,
already_set: false,
wikiName: "",
username: "",
password: "",
Expand Down Expand Up @@ -195,6 +208,9 @@ export default {
next();
},
methods: {
goToDokuwikiWebapp() {
window.open(`https://${this.host}`, "_blank");
},
async getConfiguration() {
this.loading.getConfiguration = true;
this.error.getConfiguration = "";
Expand Down Expand Up @@ -248,6 +264,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() {
Expand Down

0 comments on commit 1d2a535

Please sign in to comment.