From 99d329967c08bbe01d2d4bbd2be1f650aa48b752 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Thu, 1 Dec 2022 19:23:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=9D=A2=E6=9D=BF=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/modules/en.ts | 3 +++ frontend/src/lang/modules/zh.ts | 3 +++ frontend/src/views/container/container/index.vue | 6 +++--- frontend/src/views/container/network/index.vue | 6 ------ frontend/src/views/setting/expired.vue | 6 +++++- frontend/src/views/setting/index.vue | 3 +-- frontend/src/views/setting/tabs/about.vue | 8 ++++---- frontend/src/views/setting/tabs/panel.vue | 7 ++++++- 8 files changed, 25 insertions(+), 17 deletions(-) diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 87431a26b..03f071440 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -336,6 +336,7 @@ export default { last4Hour: 'Last 4 Hours', lastHour: 'Last Hour', last10Min: 'Last 10 Minutes', + newName: 'New name', custom: 'Custom', emptyUser: 'When empty, you will log in with the default user of container', @@ -618,6 +619,7 @@ export default { languageHelper: 'By default, it follows the browser language. This parameter takes effect only on the current browser', sessionTimeout: 'Timeout', + sessionTimeoutError: 'The minimum timeout is 300 seconds', sessionTimeoutHelper: 'If you do not operate the panel for more than {0} seconds, the panel automatically logs out', syncTime: 'Synchronization time', @@ -625,6 +627,7 @@ export default { oldPassword: 'Original password', newPassword: 'New password', retryPassword: 'Confirm password', + duplicatePassword: 'The new password cannot be the same as the original password, please re-enter!', backup: 'Backup', noTypeForCreate: 'No backup type is currently created', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 065ac8f0e..bbc4f3788 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -341,6 +341,7 @@ export default { last4Hour: '最近 4 小时', lastHour: '最近 1 小时', last10Min: '最近 10 分钟', + newName: '新名称', custom: '自定义', containerTerminal: '容器终端', @@ -636,12 +637,14 @@ export default { language: '系统语言', languageHelper: '默认跟随浏览器语言,设置后只对当前浏览器生效,更换浏览器后需要重新设置', sessionTimeout: '超时时间', + sessionTimeoutError: '最小超时时间为 300 秒', sessionTimeoutHelper: '如果用户超过 {0} 秒未操作面板,面板将自动退出登录', syncTime: '同步时间', changePassword: '密码修改', oldPassword: '原密码', newPassword: '新密码', retryPassword: '确认密码', + duplicatePassword: '新密码不能与原始密码一致,请重新输入!', backup: '备份', noTypeForCreate: '当前无可创建备份类型', diff --git a/frontend/src/views/container/container/index.vue b/frontend/src/views/container/container/index.vue index a6ecc074b..bae79b449 100644 --- a/frontend/src/views/container/container/index.vue +++ b/frontend/src/views/container/container/index.vue @@ -115,7 +115,7 @@ - + @@ -296,7 +296,7 @@ const onSubmitName = async (formEl: FormInstance | undefined) => { if (!formEl) return; formEl.validate(async (valid) => { if (!valid) return; - ContainerOperator(renameForm); + await ContainerOperator(renameForm); search(); newNameVisiable.value = false; ElMessage.success(i18n.global.t('commons.msg.operationSuccess')); diff --git a/frontend/src/views/container/network/index.vue b/frontend/src/views/container/network/index.vue index c61ed7163..f98acaa88 100644 --- a/frontend/src/views/container/network/index.vue +++ b/frontend/src/views/container/network/index.vue @@ -18,12 +18,6 @@ - - - diff --git a/frontend/src/views/setting/expired.vue b/frontend/src/views/setting/expired.vue index 3626c737b..721a58255 100644 --- a/frontend/src/views/setting/expired.vue +++ b/frontend/src/views/setting/expired.vue @@ -3,7 +3,7 @@ @@ -115,6 +115,10 @@ const submitChangePassword = async (formEl: FormInstance | undefined) => { if (!formEl) return; formEl.validate(async (valid) => { if (!valid) return; + if (settingForm.complexityVerification === 'disable' && passForm.newPassword === passForm.oldPassword) { + ElMessage.error(i18n.global.t('setting.duplicatePassword')); + return; + } let password = settingForm.complexityVerification === 'disable' ? passForm.newPassword : passForm.newPasswordComplexity; await handleExpired({ oldPassword: passForm.oldPassword, newPassword: password }); diff --git a/frontend/src/views/setting/index.vue b/frontend/src/views/setting/index.vue index e0aa43425..a98d73ebc 100644 --- a/frontend/src/views/setting/index.vue +++ b/frontend/src/views/setting/index.vue @@ -90,7 +90,7 @@ const { switchDark } = useTheme(); const SaveSetting = async (formEl: FormInstance | undefined, key: string, val: any) => { if (!formEl) return; - const result = await formEl.validateField('settingInfo.' + key[0].toLowerCase(), callback); + const result = await formEl.validateField('settingInfo.' + key.replace(key[0], key[0].toLowerCase()), callback); if (!result) { return; } @@ -109,7 +109,6 @@ const SaveSetting = async (formEl: FormInstance | undefined, key: string, val: a case 'PanelName': globalStore.setThemeConfig({ ...themeConfig.value, panelName: val }); break; - case 'SessionTimeout': case 'MonitorStoreDays': case 'ServerPort': val = val + ''; diff --git a/frontend/src/views/setting/tabs/about.vue b/frontend/src/views/setting/tabs/about.vue index 2f66c3097..7c148caa4 100644 --- a/frontend/src/views/setting/tabs/about.vue +++ b/frontend/src/views/setting/tabs/about.vue @@ -13,19 +13,19 @@

v1.0.0

- + {{ $t('setting.project') }} - + {{ $t('setting.issue') }} - + {{ $t('setting.chat') }} - + {{ $t('setting.star') }}
diff --git a/frontend/src/views/setting/tabs/panel.vue b/frontend/src/views/setting/tabs/panel.vue index d44cb479e..5ad52bfbc 100644 --- a/frontend/src/views/setting/tabs/panel.vue +++ b/frontend/src/views/setting/tabs/panel.vue @@ -95,7 +95,7 @@ @@ -199,6 +199,11 @@ const passForm = reactive({ retryPassword: '', }); +const sessionTimeoutRules = [ + Rules.number, + { min: 300, type: 'number', message: i18n.global.t('setting.sessionTimeoutError'), trigger: 'blur' }, +]; + interface Props { settingInfo: any; }