remove display password button

This commit is contained in:
MaysWind
2024-07-25 01:03:25 +08:00
parent cc55b98e80
commit a8484cfcaf
7 changed files with 25 additions and 101 deletions
+1 -10
View File
@@ -47,16 +47,13 @@
<v-col cols="12"> <v-col cols="12">
<v-text-field <v-text-field
autocomplete="current-password" autocomplete="current-password"
clearable
ref="passwordInput" ref="passwordInput"
:type="isPasswordVisible ? 'text' : 'password'" type="password"
:disabled="show2faInput || logining || verifying" :disabled="show2faInput || logining || verifying"
:label="$t('Password')" :label="$t('Password')"
:placeholder="$t('Your password')" :placeholder="$t('Your password')"
:append-inner-icon="isPasswordVisible ? icons.eyeSlash : icons.eye"
v-model="password" v-model="password"
@input="tempToken = ''" @input="tempToken = ''"
@click:append-inner="isPasswordVisible = !isPasswordVisible"
@keyup.enter="login" @keyup.enter="login"
/> />
</v-col> </v-col>
@@ -189,8 +186,6 @@ import {
import { setExpenseAndIncomeAmountColor } from '@/lib/ui.js'; import { setExpenseAndIncomeAmountColor } from '@/lib/ui.js';
import { import {
mdiEyeOutline,
mdiEyeOffOutline,
mdiOnepassword, mdiOnepassword,
mdiHelpCircleOutline mdiHelpCircleOutline
} from '@mdi/js'; } from '@mdi/js';
@@ -203,15 +198,12 @@ export default {
passcode: '', passcode: '',
backupCode: '', backupCode: '',
tempToken: '', tempToken: '',
isPasswordVisible: false,
logining: false, logining: false,
verifying: false, verifying: false,
show2faInput: false, show2faInput: false,
twoFAVerifyType: 'passcode', twoFAVerifyType: 'passcode',
showMobileQrCode: false, showMobileQrCode: false,
icons: { icons: {
eye: mdiEyeOutline,
eyeSlash: mdiEyeOffOutline,
passcode: mdiOnepassword, passcode: mdiOnepassword,
backupCode: mdiHelpCircleOutline backupCode: mdiHelpCircleOutline
} }
@@ -284,7 +276,6 @@ export default {
return; return;
} }
self.isPasswordVisible = false;
self.logining = true; self.logining = true;
self.rootStore.authorize({ self.rootStore.authorize({
+4 -16
View File
@@ -46,30 +46,24 @@
<v-col cols="12"> <v-col cols="12">
<v-text-field <v-text-field
autocomplete="new-password" autocomplete="new-password"
clearable
ref="passwordInput" ref="passwordInput"
:type="isNewPasswordVisible ? 'text' : 'password'" type="password"
:disabled="updating" :disabled="updating"
:label="$t('Password')" :label="$t('Password')"
:placeholder="$t('Your password')" :placeholder="$t('Your password')"
:append-inner-icon="isNewPasswordVisible ? icons.eyeSlash : icons.eye"
v-model="newPassword" v-model="newPassword"
@click:append-inner="isNewPasswordVisible = !isNewPasswordVisible"
@keyup.enter="$refs.confirmPasswordInput.focus()" @keyup.enter="$refs.confirmPasswordInput.focus()"
/> />
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12">
<v-text-field <v-text-field
clearable
ref="confirmPasswordInput" ref="confirmPasswordInput"
:type="isConfirmPasswordVisible ? 'text' : 'password'" type="password"
:disabled="updating" :disabled="updating"
:label="$t('Confirm Password')" :label="$t('Confirm Password')"
:placeholder="$t('Re-enter the password')" :placeholder="$t('Re-enter the password')"
:append-inner-icon="isConfirmPasswordVisible ? icons.eyeSlash : icons.eye"
v-model="confirmPassword" v-model="confirmPassword"
@click:append-inner="isConfirmPasswordVisible = !isConfirmPasswordVisible"
@keyup.enter="resetPassword" @keyup.enter="resetPassword"
/> />
</v-col> </v-col>
@@ -147,9 +141,7 @@ import { useSettingsStore } from '@/stores/setting.js';
import assetConstants from '@/consts/asset.js'; import assetConstants from '@/consts/asset.js';
import { import {
mdiChevronLeft, mdiChevronLeft
mdiEyeOffOutline,
mdiEyeOutline
} from '@mdi/js'; } from '@mdi/js';
export default { export default {
@@ -161,14 +153,10 @@ export default {
email: '', email: '',
newPassword: '', newPassword: '',
confirmPassword: '', confirmPassword: '',
isNewPasswordVisible: false,
isConfirmPasswordVisible: false,
updating: false, updating: false,
passwordChanged: false, passwordChanged: false,
icons: { icons: {
left: mdiChevronLeft, left: mdiChevronLeft
eye: mdiEyeOutline,
eyeSlash: mdiEyeOffOutline
} }
}; };
}, },
+4 -16
View File
@@ -72,27 +72,21 @@
<v-col cols="12" md="6"> <v-col cols="12" md="6">
<v-text-field <v-text-field
autocomplete="new-password" autocomplete="new-password"
clearable type="password"
:disabled="submitting || navigateToHomePage" :disabled="submitting || navigateToHomePage"
:label="$t('Password')" :label="$t('Password')"
:placeholder="$t('Your password, at least 6 characters')" :placeholder="$t('Your password, at least 6 characters')"
:type="isPasswordVisible ? 'text' : 'password'"
:append-inner-icon="isPasswordVisible ? icons.eyeSlash : icons.eye"
v-model="user.password" v-model="user.password"
@click:append-inner="isPasswordVisible = !isPasswordVisible"
/> />
</v-col> </v-col>
<v-col cols="12" md="6"> <v-col cols="12" md="6">
<v-text-field <v-text-field
autocomplete="new-password" autocomplete="new-password"
clearable type="password"
:disabled="submitting || navigateToHomePage" :disabled="submitting || navigateToHomePage"
:label="$t('Confirm Password')" :label="$t('Confirm Password')"
:placeholder="$t('Re-enter the password')" :placeholder="$t('Re-enter the password')"
:type="isConfirmPasswordVisible ? 'text' : 'password'"
:append-inner-icon="isConfirmPasswordVisible ? icons.eyeSlash : icons.eye"
v-model="user.confirmPassword" v-model="user.confirmPassword"
@click:append-inner="isConfirmPasswordVisible = !isConfirmPasswordVisible"
/> />
</v-col> </v-col>
</v-row> </v-row>
@@ -261,9 +255,7 @@ import { setExpenseAndIncomeAmountColor } from '@/lib/ui.js';
import { import {
mdiArrowLeft, mdiArrowLeft,
mdiArrowRight, mdiArrowRight,
mdiCheck, mdiCheck
mdiEyeOffOutline,
mdiEyeOutline
} from '@mdi/js'; } from '@mdi/js';
export default { export default {
@@ -274,8 +266,6 @@ export default {
return { return {
user: newUser, user: newUser,
currentStep: 'basicSetting', currentStep: 'basicSetting',
isPasswordVisible: false,
isConfirmPasswordVisible: false,
submitting: false, submitting: false,
usePresetCategories: false, usePresetCategories: false,
finalResultMessage: null, finalResultMessage: null,
@@ -283,9 +273,7 @@ export default {
icons: { icons: {
previous: mdiArrowLeft, previous: mdiArrowLeft,
next: mdiArrowRight, next: mdiArrowRight,
submit: mdiCheck, submit: mdiCheck
eye: mdiEyeOutline,
eyeSlash: mdiEyeOffOutline
} }
}; };
}, },
+3 -11
View File
@@ -36,14 +36,11 @@
<v-col cols="12" v-if="!loading && !token && email && isUserVerifyEmailEnabled"> <v-col cols="12" v-if="!loading && !token && email && isUserVerifyEmailEnabled">
<v-text-field <v-text-field
autocomplete="password" autocomplete="password"
clearable type="password"
:type="isPasswordVisible ? 'text' : 'password'"
:disabled="loading || resending" :disabled="loading || resending"
:label="$t('Password')" :label="$t('Password')"
:placeholder="$t('Your password')" :placeholder="$t('Your password')"
:append-inner-icon="isPasswordVisible ? icons.eyeSlash : icons.eye"
v-model="password" v-model="password"
@click:append-inner="isPasswordVisible = !isPasswordVisible"
@keyup.enter="resendEmail" @keyup.enter="resendEmail"
/> />
</v-col> </v-col>
@@ -123,9 +120,7 @@ import assetConstants from '@/consts/asset.js';
import { isUserVerifyEmailEnabled } from '@/lib/server_settings.js'; import { isUserVerifyEmailEnabled } from '@/lib/server_settings.js';
import { import {
mdiChevronLeft, mdiChevronLeft
mdiEyeOffOutline,
mdiEyeOutline
} from '@mdi/js'; } from '@mdi/js';
export default { export default {
@@ -137,15 +132,12 @@ export default {
data() { data() {
return { return {
password: '', password: '',
isPasswordVisible: false,
loading: true, loading: true,
resending: false, resending: false,
verified: false, verified: false,
errorMessage: '', errorMessage: '',
icons: { icons: {
left: mdiChevronLeft, left: mdiChevronLeft
eye: mdiEyeOutline,
eyeSlash: mdiEyeOffOutline
} }
}; };
}, },
@@ -129,16 +129,14 @@
<v-row class="mb-3"> <v-row class="mb-3">
<v-col cols="12" md="6"> <v-col cols="12" md="6">
<v-text-field <v-text-field
ref="currentPasswordInput"
autocomplete="current-password" autocomplete="current-password"
clearable variant="underlined" ref="currentPasswordInput"
type="password"
variant="underlined"
color="error" color="error"
:disabled="loadingDataStatistics || clearingData" :disabled="loadingDataStatistics || clearingData"
:placeholder="$t('Current Password')" :placeholder="$t('Current Password')"
:type="isCurrentPasswordVisible ? 'text' : 'password'"
:append-inner-icon="isCurrentPasswordVisible ? icons.eyeSlash : icons.eye"
v-model="currentPasswordForClearData" v-model="currentPasswordForClearData"
@click:append-inner="isCurrentPasswordVisible = !isCurrentPasswordVisible"
@keyup.enter="clearData" @keyup.enter="clearData"
/> />
</v-col> </v-col>
@@ -176,9 +174,7 @@ import {
mdiCreditCardOutline, mdiCreditCardOutline,
mdiViewDashboardOutline, mdiViewDashboardOutline,
mdiTagOutline, mdiTagOutline,
mdiAlert, mdiAlert
mdiEyeOutline,
mdiEyeOffOutline
} from '@mdi/js'; } from '@mdi/js';
export default { export default {
@@ -188,7 +184,6 @@ export default {
dataStatistics: null, dataStatistics: null,
exportingData: false, exportingData: false,
currentPasswordForClearData: '', currentPasswordForClearData: '',
isCurrentPasswordVisible: false,
clearingData: false, clearingData: false,
icons: { icons: {
refresh: mdiRefresh, refresh: mdiRefresh,
@@ -196,9 +191,7 @@ export default {
accounts: mdiCreditCardOutline, accounts: mdiCreditCardOutline,
categories: mdiViewDashboardOutline, categories: mdiViewDashboardOutline,
tags: mdiTagOutline, tags: mdiTagOutline,
alert: mdiAlert, alert: mdiAlert
eye: mdiEyeOutline,
eyeSlash: mdiEyeOffOutline
} }
} }
}, },
@@ -284,7 +277,6 @@ export default {
self.$refs.confirmDialog.open('Are you sure you want to clear all data?', { color: 'error' }).then(() => { self.$refs.confirmDialog.open('Are you sure you want to clear all data?', { color: 'error' }).then(() => {
self.clearingData = true; self.clearingData = true;
self.isCurrentPasswordVisible = false;
self.rootStore.clearUserData({ self.rootStore.clearUserData({
password: self.currentPasswordForClearData password: self.currentPasswordForClearData
@@ -11,16 +11,13 @@
<v-row> <v-row>
<v-col cols="12" md="6"> <v-col cols="12" md="6">
<v-text-field <v-text-field
ref="currentPasswordInput"
autocomplete="current-password" autocomplete="current-password"
clearable ref="currentPasswordInput"
type="password"
:disabled="updatingPassword" :disabled="updatingPassword"
:label="$t('Current Password')" :label="$t('Current Password')"
:placeholder="$t('Current Password')" :placeholder="$t('Current Password')"
:type="isCurrentPasswordVisible ? 'text' : 'password'"
:append-inner-icon="isCurrentPasswordVisible ? icons.eyeSlash : icons.eye"
v-model="currentPassword" v-model="currentPassword"
@click:append-inner="isCurrentPasswordVisible = !isCurrentPasswordVisible"
@keyup.enter="$refs.newPasswordInput.focus()" @keyup.enter="$refs.newPasswordInput.focus()"
/> />
</v-col> </v-col>
@@ -29,16 +26,13 @@
<v-row> <v-row>
<v-col cols="12" md="6"> <v-col cols="12" md="6">
<v-text-field <v-text-field
ref="newPasswordInput"
autocomplete="new-password" autocomplete="new-password"
clearable ref="newPasswordInput"
type="password"
:disabled="updatingPassword" :disabled="updatingPassword"
:label="$t('New Password')" :label="$t('New Password')"
:placeholder="$t('New Password')" :placeholder="$t('New Password')"
:type="isNewPasswordVisible ? 'text' : 'password'"
:append-inner-icon="isNewPasswordVisible ? icons.eyeSlash : icons.eye"
v-model="newPassword" v-model="newPassword"
@click:append-inner="isNewPasswordVisible = !isNewPasswordVisible"
@keyup.enter="$refs.confirmPasswordInput.focus()" @keyup.enter="$refs.confirmPasswordInput.focus()"
/> />
</v-col> </v-col>
@@ -48,14 +42,11 @@
<v-col cols="12" md="6"> <v-col cols="12" md="6">
<v-text-field <v-text-field
ref="confirmPasswordInput" ref="confirmPasswordInput"
clearable type="password"
:disabled="updatingPassword" :disabled="updatingPassword"
:type="isConfirmPasswordVisible ? 'text' : 'password'"
:label="$t('Confirm Password')" :label="$t('Confirm Password')"
:placeholder="$t('Re-enter the password')" :placeholder="$t('Re-enter the password')"
:append-inner-icon="isConfirmPasswordVisible ? icons.eyeSlash : icons.eye"
v-model="confirmPassword" v-model="confirmPassword"
@click:append-inner="isConfirmPasswordVisible = !isConfirmPasswordVisible"
@keyup.enter="updatePassword" @keyup.enter="updatePassword"
/> />
</v-col> </v-col>
@@ -149,8 +140,6 @@ import { parseDeviceInfo, parseUserAgent } from '@/lib/misc.js';
import { import {
mdiRefresh, mdiRefresh,
mdiEyeOffOutline,
mdiEyeOutline,
mdiCellphone, mdiCellphone,
mdiTablet, mdiTablet,
mdiWatch, mdiWatch,
@@ -165,15 +154,10 @@ export default {
currentPassword: '', currentPassword: '',
newPassword: '', newPassword: '',
confirmPassword: '', confirmPassword: '',
isCurrentPasswordVisible: false,
isNewPasswordVisible: false,
isConfirmPasswordVisible: false,
updatingPassword: false, updatingPassword: false,
loadingSession: true, loadingSession: true,
icons: { icons: {
refresh: mdiRefresh, refresh: mdiRefresh
eye: mdiEyeOutline,
eyeSlash: mdiEyeOffOutline
} }
}; };
}, },
@@ -245,9 +229,6 @@ export default {
} }
self.updatingPassword = true; self.updatingPassword = true;
self.isCurrentPasswordVisible = false;
self.isNewPasswordVisible = false;
self.isConfirmPasswordVisible = false;
self.rootStore.updateUserProfile({ self.rootStore.updateUserProfile({
profile: { profile: {
@@ -42,13 +42,11 @@
<v-col cols="12" md="6"> <v-col cols="12" md="6">
<v-text-field <v-text-field
autocomplete="current-password" autocomplete="current-password"
clearable variant="underlined" type="password"
variant="underlined"
:disabled="loading || enabling || enableConfirming || disabling" :disabled="loading || enabling || enableConfirming || disabling"
:placeholder="$t('Current Password')" :placeholder="$t('Current Password')"
:type="isCurrentPasswordVisible ? 'text' : 'password'"
:append-inner-icon="isCurrentPasswordVisible ? icons.eyeSlash : icons.eye"
v-model="currentPassword" v-model="currentPassword"
@click:append-inner="isCurrentPasswordVisible = !isCurrentPasswordVisible"
/> />
</v-col> </v-col>
</v-row> </v-row>
@@ -111,8 +109,6 @@ import { useTwoFactorAuthStore } from '@/stores/twoFactorAuth.js';
import { makeButtonCopyToClipboard, changeClipboardObjectText } from '@/lib/misc.js'; import { makeButtonCopyToClipboard, changeClipboardObjectText } from '@/lib/misc.js';
import { import {
mdiEyeOutline,
mdiEyeOffOutline,
mdiContentCopy mdiContentCopy
} from '@mdi/js'; } from '@mdi/js';
@@ -127,7 +123,6 @@ export default {
new2FASecret: '', new2FASecret: '',
new2FAQRCode: '', new2FAQRCode: '',
currentPassword: '', currentPassword: '',
isCurrentPasswordVisible: false,
currentPasscode: '', currentPasscode: '',
currentBackupCode: '', currentBackupCode: '',
enabling: false, enabling: false,
@@ -136,8 +131,6 @@ export default {
regenerating: false, regenerating: false,
clipboardHolder: null, clipboardHolder: null,
icons: { icons: {
eye: mdiEyeOutline,
eyeSlash: mdiEyeOffOutline,
copy: mdiContentCopy copy: mdiContentCopy
} }
}; };
@@ -173,7 +166,6 @@ export default {
this.new2FASecret = ''; this.new2FASecret = '';
this.new2FAQRCode = ''; this.new2FAQRCode = '';
this.currentPassword = ''; this.currentPassword = '';
this.isCurrentPasswordVisible = false;
this.currentPasscode = ''; this.currentPasscode = '';
this.currentBackupCode = ''; this.currentBackupCode = '';
this.enabling = false; this.enabling = false;