From 009919f927853b1c0d7bdc1d50458fb325ec9289 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:02:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=BC=96=E8=BE=91=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#3556)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/global/form-rules.ts | 2 +- frontend/src/lang/modules/en.ts | 2 +- frontend/src/lang/modules/tw.ts | 2 +- frontend/src/lang/modules/zh.ts | 2 +- frontend/src/views/cronjob/operate/index.vue | 10 +++++++--- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/src/global/form-rules.ts b/frontend/src/global/form-rules.ts index dbcff02da..ac4fe008f 100644 --- a/frontend/src/global/form-rules.ts +++ b/frontend/src/global/form-rules.ts @@ -171,7 +171,7 @@ const checkDBName = (rule: any, value: any, callback: any) => { if (value === '' || typeof value === 'undefined' || value == null) { callback(new Error(i18n.global.t('commons.rule.dbName'))); } else { - const reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{1}[a-zA-Z0-9_.\u4e00-\u9fa5-]{0,64}$/; + const reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{1}[a-zA-Z0-9_.\u4e00-\u9fa5-]{0,63}$/; if (!reg.test(value) && value !== '') { callback(new Error(i18n.global.t('commons.rule.dbName'))); } else { diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 80d88a529..9315b0672 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -815,7 +815,7 @@ const message = { target: 'Target', targetHelper: 'Third-party backup accounts are maintained in panel settings.', retainCopies: 'Retain copies', - retainCopiesHelper: 'Number of copies of execution records, log files, and backup files', + retainCopiesHelper: 'Retention of Execution Records', cronSpecRule: 'Please enter a correct lifecycle', perMonth: 'Every monthly', perWeek: 'Every week', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 2a08c0469..6dfa6c595 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -776,7 +776,7 @@ const message = { target: '備份到', targetHelper: '第三方備份賬號在面板設置中維護', retainCopies: '保留份數', - retainCopiesHelper: '執行記錄、日誌文件、備份文件保留份數', + retainCopiesHelper: '執行記錄保留份數', cronSpecRule: '請輸入正確的執行周期', perMonth: '每月', perWeek: '每周', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 523057674..09193b5b4 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -777,7 +777,7 @@ const message = { target: '备份到', targetHelper: '第三方备份账号在面板设置中维护', retainCopies: '保留份数', - retainCopiesHelper: '执行记录、日志文件、备份文件保留份数', + retainCopiesHelper: '执行记录保留份数', cronSpecRule: '请输入正确的执行周期', perMonth: '每月', perWeek: '每周', diff --git a/frontend/src/views/cronjob/operate/index.vue b/frontend/src/views/cronjob/operate/index.vue index 7181f2552..57f343bbe 100644 --- a/frontend/src/views/cronjob/operate/index.vue +++ b/frontend/src/views/cronjob/operate/index.vue @@ -332,7 +332,11 @@ const acceptParams = (params: DialogProps): void => { loadAppInstalls(); loadWebsites(); loadContainers(); - loadDatabases(); + if (dialogData.value.rowData?.dbType) { + loadDatabases(dialogData.value.rowData.dbType); + } else { + loadDatabases('mysql'); + } }; const emit = defineEmits<{ (e: 'search'): void }>(); @@ -477,8 +481,8 @@ const hasHour = () => { ); }; -const loadDatabases = async () => { - const data = await listDbItems(dialogData.value.rowData.dbType); +const loadDatabases = async (dbType: string) => { + const data = await listDbItems(dbType); dbInfo.dbs = data.data || []; };