fix: refs #7699 fix password visibility
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-12-24 09:52:31 +01:00
parent 550340e720
commit 01f63ff239
1 changed files with 21 additions and 13 deletions

View File

@ -19,8 +19,8 @@ const changePassDialog = ref();
const passwords = ref({ newPassword: null, repeatPassword: null }); const passwords = ref({ newPassword: null, repeatPassword: null });
const requirements = ref([]); const requirements = ref([]);
const isLoading = ref(false); const isLoading = ref(false);
const showPwd = true; const showPwd = ref(true);
const showRpPwd = true; const showRpPwd = ref(true);
const validate = async () => { const validate = async () => {
const { newPassword, repeatPassword, oldPassword } = passwords.value; const { newPassword, repeatPassword, oldPassword } = passwords.value;
@ -76,10 +76,18 @@ defineExpose({ show: () => changePassDialog.value.show() });
v-if="props.askOldPass" v-if="props.askOldPass"
:label="t('Old password')" :label="t('Old password')"
v-model="passwords.oldPassword" v-model="passwords.oldPassword"
type="password" :type="showPwd ? 'password' : 'text'"
:required="true" :required="true"
autofocus autofocus
/> >
<template #append>
<QIcon
:name="showPwd ? 'visibility_off' : 'visibility'"
class="cursor-pointer"
@click="showPwd = !showPwd"
/>
</template>
</VnInput>
<VnInput <VnInput
:required="true" :required="true"
autofocus autofocus
@ -87,7 +95,6 @@ defineExpose({ show: () => changePassDialog.value.show() });
:label="$t('New password')" :label="$t('New password')"
:type="showPwd ? 'password' : 'text'" :type="showPwd ? 'password' : 'text'"
hint="" hint=""
filled
> >
<template #append> <template #append>
<QIcon <QIcon
@ -102,14 +109,15 @@ defineExpose({ show: () => changePassDialog.value.show() });
v-model="passwords.repeatPassword" v-model="passwords.repeatPassword"
:type="showRpPwd ? 'password' : 'text'" :type="showRpPwd ? 'password' : 'text'"
hint="" hint=""
/> >
<template #append> <template #append>
<QIcon <QIcon
:name="showRpPwd ? 'visibility_off' : 'visibility'" :name="showRpPwd ? 'visibility_off' : 'visibility'"
class="cursor-pointer" class="cursor-pointer"
@click="showRpPwd = !showRpPwd" @click="showRpPwd = !showRpPwd"
/> />
</template> </template>
</VnInput>
</QCardSection> </QCardSection>
</QForm> </QForm>
<QCardActions> <QCardActions>