Skip to content

Commit

Permalink
Disable input fields if already set in Settings.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Mar 13, 2024
1 parent c3c3ac6 commit 543755f
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
</cv-text-input>
Expand All @@ -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"
>
</cv-text-input>
Expand All @@ -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"
>
</cv-text-input>
Expand All @@ -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"
>
</cv-text-input>
Expand All @@ -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"
>
</cv-text-input>
Expand Down Expand Up @@ -152,6 +152,7 @@ export default {
page: "settings",
},
urlCheckInterval: null,
already_set: false,
wikiName: "",
username: "",
password: "",
Expand Down Expand Up @@ -248,6 +249,18 @@ export default {
this.isLetsEncryptEnabled = config.lets_encrypt;
this.isHttpToHttpsEnabled = config.http2https;
this.loading.getConfiguration = false;
// set already_set to true if the configuration is empty
if (
this.wikiName &&
this.username &&
this.password &&
this.userFullName &&
this.email &&
this.host
) {
this.already_set = true;
}
this.focusElement("wikiName");
},
validateConfigureModule() {
Expand Down

0 comments on commit 543755f

Please sign in to comment.