From 3dca8e3a9c2b90091cc4bce583f16aa66862877c Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 9 Jan 2024 22:33:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E6=8A=BD=E5=B1=89=E5=86=85=E5=AE=B9=E8=BF=87=E5=A4=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=AE=8C=E6=95=B4=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#3547)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/drawer-header/index.vue | 5 ++++- 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/container/container/operate/index.vue | 6 +++++- frontend/src/views/container/container/terminal/index.vue | 1 + frontend/src/views/database/mysql/bind/index.vue | 3 +++ frontend/src/views/database/postgresql/bind/index.vue | 3 +++ .../src/views/database/postgresql/remote/delete/index.vue | 1 + 10 files changed, 21 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/drawer-header/index.vue b/frontend/src/components/drawer-header/index.vue index 993165bbb..b9ba3f61d 100644 --- a/frontend/src/components/drawer-header/index.vue +++ b/frontend/src/components/drawer-header/index.vue @@ -4,7 +4,10 @@ {{ header }} - - {{ resource }} + + {{ resource.substring(0, 23) + '...' }} + + {{ resource }} diff --git a/frontend/src/global/form-rules.ts b/frontend/src/global/form-rules.ts index 3c11e7c1d..dbcff02da 100644 --- a/frontend/src/global/form-rules.ts +++ b/frontend/src/global/form-rules.ts @@ -413,7 +413,7 @@ const checkContainerName = (rule: any, value: any, callback: any) => { if (value === '' || typeof value === 'undefined' || value == null) { callback(); } else { - const reg = /^[a-zA-Z0-9][a-zA-Z0-9_.-]{1,127}$/; + const reg = /^[a-zA-Z0-9]{1}[a-zA-Z0-9_.-]{1,127}$/; if (!reg.test(value) && value !== '') { callback(new Error(i18n.global.t('commons.rule.containerName'))); } else { diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index ed5df8752..8970c14f7 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -184,7 +184,7 @@ const message = { paramUrlAndPort: 'The format is http(s)://(domain name/ip):(port)', nginxDoc: 'Only supports English case, numbers, and .', appName: 'Support English, numbers, - and _, length 2-30, and cannot start and end with -_', - containerName: 'Supports letters, numbers, -, _ and .; cannot start with - _ or .; length: 2-127', + containerName: 'Supports letters, numbers, -, _ and .; cannot start with - _ or .; length: 2-128', mirror: 'Support image accelerator addresses that start with http(s)://, English uppercase and lowercase letters, numbers, periods, and hyphens, and there should be no empty lines.', disableFunction: 'Only support letters ,underscores,and,', leechExts: 'Only support letters, numbers and,', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 30ddd5742..73ad899d0 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -183,7 +183,7 @@ const message = { paramUrlAndPort: '格式為 http(s)://(域名/ip):(端口)', nginxDoc: '僅支持英文大小寫,數字,和.', appName: '支持英文、數字、-和_,長度2-30,並且不能以-_開頭和結尾', - containerName: '支持字母、數字、_-和.,不能以-_或.開頭,長度2-127', + containerName: '支持字母、數字、_-和.,不能以-_或.開頭,長度2-128', mirror: '支持以 http(s):// 開頭,英文大小寫,數字,. 和 - 的鏡像加速地址,且不能有空行', disableFunction: '僅支持字母、下劃線和,', leechExts: '僅支持字母數字和,', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 5d942a3dd..9023390ce 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -183,7 +183,7 @@ const message = { paramUrlAndPort: '格式为 http(s)://(域名/ip):(端口)', nginxDoc: '仅支持英文大小写,数字,和.', appName: '支持英文、数字、-和_,长度2-30,并且不能以-_开头和结尾', - containerName: '支持字母、数字、_-和.,不能以-_或.开头,长度2-127', + containerName: '支持字母、数字、_-和.,不能以-_或.开头,长度2-128', mirror: '支持以 http(s):// 开头,英文大小写,数字,. 和 - 的镜像加速地址,且不能有空行', disableFunction: '仅支持字母、下划线和,', leechExts: '仅支持字母数字和,', diff --git a/frontend/src/views/container/container/operate/index.vue b/frontend/src/views/container/container/operate/index.vue index f27875b2c..4f80b134e 100644 --- a/frontend/src/views/container/container/operate/index.vue +++ b/frontend/src/views/container/container/operate/index.vue @@ -240,7 +240,11 @@ {{ $t('container.limitHelper', [limits.cpu]) }}{{ $t('commons.units.core') }} - + diff --git a/frontend/src/views/container/container/terminal/index.vue b/frontend/src/views/container/container/terminal/index.vue index cff4591f6..59cdba944 100644 --- a/frontend/src/views/container/container/terminal/index.vue +++ b/frontend/src/views/container/container/terminal/index.vue @@ -95,6 +95,7 @@ const initTerm = (formEl: FormInstance | undefined) => { endpoint: '/api/v1/containers/exec', args: `containerid=${form.containerID}&user=${form.user}&command=${form.command}`, error: '', + initCmd: '', }); }); }; diff --git a/frontend/src/views/database/mysql/bind/index.vue b/frontend/src/views/database/mysql/bind/index.vue index a9aa2e0d2..812fef41a 100644 --- a/frontend/src/views/database/mysql/bind/index.vue +++ b/frontend/src/views/database/mysql/bind/index.vue @@ -101,6 +101,9 @@ interface DialogProps { const acceptParams = (params: DialogProps): void => { form.database = params.database; form.mysqlName = params.mysqlName; + form.username = ''; + form.password = ''; + form.permission = '%'; form.from = params.from; bindVisible.value = true; }; diff --git a/frontend/src/views/database/postgresql/bind/index.vue b/frontend/src/views/database/postgresql/bind/index.vue index 5bbe72541..a23e4f996 100644 --- a/frontend/src/views/database/postgresql/bind/index.vue +++ b/frontend/src/views/database/postgresql/bind/index.vue @@ -69,6 +69,9 @@ interface DialogProps { const acceptParams = (params: DialogProps): void => { form.database = params.database; form.name = params.name; + form.username = ''; + form.password = ''; + form.superUser = true; bindVisible.value = true; }; const emit = defineEmits<{ (e: 'search'): void }>(); diff --git a/frontend/src/views/database/postgresql/remote/delete/index.vue b/frontend/src/views/database/postgresql/remote/delete/index.vue index 10904f6a9..7b8b8ca71 100644 --- a/frontend/src/views/database/postgresql/remote/delete/index.vue +++ b/frontend/src/views/database/postgresql/remote/delete/index.vue @@ -66,6 +66,7 @@ interface DialogProps { const emit = defineEmits<{ (e: 'search'): void }>(); const acceptParams = async (prop: DialogProps) => { + deleteInfo.value = ''; deleteReq.value = { id: prop.id, database: prop.database,