fix: 系统密码过期样式调整

pull/57/head
ssongliu 2022-12-01 17:35:21 +08:00 committed by ssongliu
parent 986ecf5d16
commit 921eb08dd7
3 changed files with 19 additions and 4 deletions

View File

@ -356,8 +356,8 @@ export default {
mount: 'Mount', mount: 'Mount',
serverPath: 'Server path', serverPath: 'Server path',
containerDir: 'Container path', containerDir: 'Container path',
modeRW: 'Read-Write', modeRW: 'RW',
modeR: 'Read-Only', modeR: 'R',
mode: 'Mode', mode: 'Mode',
env: 'Environment', env: 'Environment',
restartPolicy: 'Restart policy', restartPolicy: 'Restart policy',
@ -652,6 +652,7 @@ export default {
unSetting: 'Not set', unSetting: 'Not set',
noneSetting: noneSetting:
'Set the expiration time for the panel password. After the expiration, you need to reset the password', 'Set the expiration time for the panel password. After the expiration, you need to reset the password',
expirationHelper: 'If the password expiration time is [0] days, the password expiration function is disabled',
days: 'Expiration Days', days: 'Expiration Days',
expiredHelper: 'The current password has expired. Please change the password again.', expiredHelper: 'The current password has expired. Please change the password again.',
timeoutHelper: timeoutHelper:

View File

@ -666,6 +666,7 @@ export default {
expirationTime: '', expirationTime: '',
unSetting: '', unSetting: '',
noneSetting: '', noneSetting: '',
expirationHelper: ' [0] ',
days: '', days: '',
expiredHelper: '', expiredHelper: '',
timeoutHelper: ' {0} ', timeoutHelper: ' {0} ',

View File

@ -17,7 +17,7 @@
> >
<el-input disabled v-model="form.settingInfo.expirationTime"> <el-input disabled v-model="form.settingInfo.expirationTime">
<template #append> <template #append>
<el-button @click="timeoutVisiable = true" icon="Collection"> <el-button @click="onChangeExoirationTime" icon="Setting">
{{ $t('commons.button.set') }} {{ $t('commons.button.set') }}
</el-button> </el-button>
</template> </template>
@ -102,10 +102,17 @@
</el-row> </el-row>
</el-card> </el-card>
</el-form> </el-form>
<el-dialog v-model="timeoutVisiable" :title="$t('setting.expirationTime')" width="30%"> <el-dialog
v-model="timeoutVisiable"
:destroy-on-close="true"
:close-on-click-modal="false"
:title="$t('setting.expirationTime')"
width="30%"
>
<el-form ref="timeoutFormRef" label-width="80px" label-position="left" :model="timeoutForm"> <el-form ref="timeoutFormRef" label-width="80px" label-position="left" :model="timeoutForm">
<el-form-item :label="$t('setting.days')" prop="days" :rules="Rules.number"> <el-form-item :label="$t('setting.days')" prop="days" :rules="Rules.number">
<el-input clearable v-model.number="timeoutForm.days" /> <el-input clearable v-model.number="timeoutForm.days" />
<span class="input-help">{{ $t('setting.expirationHelper') }}</span>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -138,6 +145,7 @@ const form = withDefaults(defineProps<Props>(), {
settingInfo: { settingInfo: {
serverPort: '', serverPort: '',
securityEntrance: '', securityEntrance: '',
expirationDays: 0,
expirationTime: '', expirationTime: '',
complexityVerification: '', complexityVerification: '',
mfaStatus: '', mfaStatus: '',
@ -188,6 +196,11 @@ const onCancelMfaBind = async () => {
isMFAShow.value = false; isMFAShow.value = false;
}; };
const onChangeExoirationTime = async () => {
timeoutForm.days = form.settingInfo.expirationDays;
timeoutVisiable.value = true;
};
const submitTimeout = async (formEl: FormInstance | undefined) => { const submitTimeout = async (formEl: FormInstance | undefined) => {
if (!formEl) return; if (!formEl) return;
formEl.validate(async (valid) => { formEl.validate(async (valid) => {