Skip to content

Commit

Permalink
Merge pull request #491 from Infraviored/v3.5-dev
Browse files Browse the repository at this point in the history
Implement "Remember Password" Feature
  • Loading branch information
chrishamm authored Sep 10, 2024
2 parents 4f5b52a + 783f5ec commit 83c9bb4
Show file tree
Hide file tree
Showing 15 changed files with 2,354 additions and 1,182 deletions.
3,439 changes: 2,286 additions & 1,153 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 28 additions & 2 deletions src/components/dialogs/ConnectDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:placeholder="$t(passwordRequired ? 'dialog.connect.passwordPlaceholder' : 'dialog.connect.passwordPlaceholderOptional')"
v-model="password" :autofocus="passwordRequired" :rules="passwordRules"
:required="passwordRequired" />
<v-checkbox v-model="rememberPassword" :label="$t('dialog.connect.rememberPassword')" />
</v-card-text>

<v-card-actions>
Expand Down Expand Up @@ -52,6 +53,7 @@ export default Vue.extend({
passwordRules: [
(value: string): string | boolean => (!value && store.state.passwordRequired) ? this.$t("dialog.connect.passwordRequired") : true
],
rememberPassword: false,
shown: false
}
},
Expand All @@ -65,6 +67,11 @@ export default Vue.extend({
hostname: this.hostname,
password: this.password
});
if (this.rememberPassword) {
this.savePassword();
} else {
this.clearPassword();
}
this.password = "";
} catch (e) {
console.warn(e);
Expand All @@ -74,15 +81,34 @@ export default Vue.extend({
},
close() {
store.commit("hideConnectDialog");
},
savePassword() {
localStorage.setItem('dwc-password', this.password);
},
loadPassword() {
const savedPassword = localStorage.getItem('dwc-password');
if (savedPassword) {
this.password = savedPassword;
this.rememberPassword = true;
}
},
clearPassword() {
localStorage.removeItem('dwc-password');
}
},
mounted() {
this.hostname = this.passwordRequired ? location.host : this.lastHostname;
this.shown = this.connectDialogShown;
this.loadPassword();
},
watch: {
connectDialogShown(to: boolean) { this.shown = to; },
connectDialogShown(to: boolean) {
this.shown = to;
if (to) {
this.loadPassword();
}
},
lastHostname(to: string) { this.hostname = to; }
}
});
</script>
</script>
5 changes: 3 additions & 2 deletions src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"passwordPlaceholderOptional": "Passwort (optional)",
"passwordPlaceholder": "Passwort",
"passwordRequired": "Passwort ist erforderlich",
"connect": "Verbinden"
"connect": "Verbinden",
"rememberPassword": "Passwort merken"
},
"connection": {
"connecting": "Verbinde...",
Expand Down Expand Up @@ -1095,4 +1096,4 @@
"refreshNote": "Laden Sie die Seite neu um einige DWC-Plugins zu entladen"
}
}
}
}
3 changes: 2 additions & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
"passwordPlaceholderOptional": "Password (optional)",
"passwordPlaceholder": "Password",
"passwordRequired": "Password is required",
"rememberPassword": "Remember Password",
"connect": "Connect"
},
"connection": {
Expand Down Expand Up @@ -1094,4 +1095,4 @@
"refreshNote": "Refresh the page to finish unloading some DWC plugins"
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"passwordPlaceholderOptional": "Contraseña (opcional)",
"passwordPlaceholder": "Contraseña",
"passwordRequired": "Es obligatorio introducir la contraseña",
"connect": "Conectar"
"connect": "Conectar",
"rememberPassword": "Recordar contraseña"
},
"connection": {
"connecting": "Conectando...",
Expand Down Expand Up @@ -1095,4 +1096,4 @@
"refreshNote": "Actualice la página para terminar de descargar algunos complementos de DWC"
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"passwordPlaceholderOptional": "Mot de Passe (optionnel)",
"passwordPlaceholder": "Mot de Passe",
"passwordRequired": "Mot de Passe requis",
"connect": "Connexion"
"connect": "Connexion",
"rememberPassword": "Se souvenir du mot de passe"
},
"connection": {
"connecting": "Connexion...",
Expand Down Expand Up @@ -1095,4 +1096,4 @@
"refreshNote": "Rafraîchissez la page pour terminer le déchargement de certains plugins DWC."
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"passwordPlaceholderOptional": "Jelszó (opcionális)",
"passwordPlaceholder": "Jelszó",
"passwordRequired": "Jelszó kötelező",
"connect": "Kapcsolódás"
"connect": "Kapcsolódás",
"rememberPassword": "Jelszó megjegyzése"
},
"connection": {
"connecting": "Kapcsolódás...",
Expand Down Expand Up @@ -1094,4 +1095,4 @@
"refreshNote": "Bizonyos DWC plugin-ek teljes leállításához az oldal frissítése szükséges!"
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"passwordPlaceholderOptional": "パスワード (オプション)",
"passwordPlaceholder": "パスワード",
"passwordRequired": "パスワードが必要です",
"connect": "接続"
"connect": "接続",
"rememberPassword": "パスワードを記憶する"
},
"connection": {
"connecting": "接続中...",
Expand Down Expand Up @@ -1095,4 +1096,4 @@
"refreshNote": "DWCプラグインのアンロードを終了するため、ページを更新します"
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@
"passwordPlaceholderOptional": "Wachtwoord (optioneel)",
"passwordRequired": "Een wachtwoord is verplicht",
"prompt": "Voer de hostnaam en het wachtwoord in van de machine waarmee u verbinding wilt maken:",
"title": "Maak verbinding met automaat"
"title": "Maak verbinding met automaat",
"rememberPassword": "Wachtwoord onthouden"
},
"connection": {
"connecting": "Verbinden...",
Expand Down Expand Up @@ -1094,4 +1095,4 @@
"uninstall": "Verwijderen"
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"passwordPlaceholderOptional": "Hasło (opcjonalnie)",
"passwordPlaceholder": "Hasło",
"passwordRequired": "Hasło jest wymagane",
"connect": "Połącz"
"connect": "Połącz",
"rememberPassword": "Zapamiętaj hasło"
},
"connection": {
"connecting": "Łączenie...",
Expand Down Expand Up @@ -1095,4 +1096,4 @@
"refreshNote": "Odśwież stronę aby zakończyć rozpakowywanie niektórych wtyczek DWC"
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/pt_br.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"passwordPlaceholderOptional": "Senha (opcional)",
"passwordPlaceholder": "Senha",
"passwordRequired": "Senha é obrigatória",
"connect": "Conectar"
"connect": "Conectar",
"rememberPassword": "Lembrar senha"
},
"connection": {
"connecting": "Conectando...",
Expand Down Expand Up @@ -1095,4 +1096,4 @@
"writeSystem": "Gravar arquivos no diretório do sistema",
"writeWeb": "Gravar arquivos no diretório da web"
}
}
}
7 changes: 4 additions & 3 deletions src/i18n/ru.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"language": "Русский",
"$vuetify": {
"badge": "знак",
Expand Down Expand Up @@ -169,7 +169,8 @@
"passwordPlaceholderOptional": "Пароль (опционально)",
"passwordPlaceholder": "Пароль",
"passwordRequired": "Пароль необходим",
"connect": "Подключение"
"connect": "Подключение",
"rememberPassword": "Запомнить пароль"
},
"connection": {
"connecting": "Подключение...",
Expand Down Expand Up @@ -1095,4 +1096,4 @@
"uninstall": "Удалить"
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"passwordPlaceholderOptional": "Parola (opsiyonel)",
"passwordPlaceholder": "Parola",
"passwordRequired": "Parola gerekli",
"connect": "Bağlan"
"connect": "Bağlan",
"rememberPassword": "Şifreyi hatırla"
},
"connection": {
"connecting": "Bağlanıyor...",
Expand Down Expand Up @@ -1095,4 +1096,4 @@
"uninstall": "Kaldır"
}
}
}
}
7 changes: 4 additions & 3 deletions src/i18n/uk.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"language": "Українська",
"$vuetify": {
"badge": "знак",
Expand Down Expand Up @@ -169,7 +169,8 @@
"passwordPlaceholderOptional": "Пароль (необов'язково)",
"passwordPlaceholder": "Пароль",
"passwordRequired": "Потрібно вказати пароль",
"connect": "Підключитися"
"connect": "Підключитися",
"rememberPassword": "Запам'ятати пароль"
},
"connection": {
"connecting": "Підключення...",
Expand Down Expand Up @@ -1094,4 +1095,4 @@
"refreshNote": "Оновіть сторінку, щоб завершити вивантаження деяких DWC плагінів"
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"passwordPlaceholderOptional": "密码(可选)",
"passwordPlaceholder": "密码",
"passwordRequired": "密码是必需的",
"connect": "连接"
"connect": "连接",
"rememberPassword": "记住密码"
},
"connection": {
"connecting": "正在连接……",
Expand Down Expand Up @@ -1094,4 +1095,4 @@
"refreshNote": "某些DWC插件卸载完成后需要刷新页面"
}
}
}
}

0 comments on commit 83c9bb4

Please sign in to comment.