From f4d5b5437e28daca6b46584ce82c0a93d89f179e Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 8 Aug 2023 22:30:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=A0=A1=E9=AA=8C=20(#1881)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/dto/database.go | 2 +- backend/app/dto/image_repo.go | 4 +- backend/app/dto/remote_db.go | 2 +- frontend/src/lang/modules/en.ts | 1 + frontend/src/lang/modules/tw.ts | 1 + frontend/src/lang/modules/zh.ts | 1 + .../views/container/setting/mirror/index.vue | 62 ++++++++--- .../container/setting/registry/index.vue | 42 +++++-- .../views/database/mysql/password/index.vue | 104 +++++++++--------- 9 files changed, 144 insertions(+), 75 deletions(-) diff --git a/backend/app/dto/database.go b/backend/app/dto/database.go index 01a51f1be..30233a435 100644 --- a/backend/app/dto/database.go +++ b/backend/app/dto/database.go @@ -117,7 +117,7 @@ type MysqlConfUpdateByFile struct { type ChangeDBInfo struct { ID uint `json:"id"` - From string `json:"from" validate:"required"` + From string `json:"from"` Value string `json:"value" validate:"required"` } diff --git a/backend/app/dto/image_repo.go b/backend/app/dto/image_repo.go index a6bea3f70..7cfda3dfc 100644 --- a/backend/app/dto/image_repo.go +++ b/backend/app/dto/image_repo.go @@ -15,8 +15,8 @@ type ImageRepoUpdate struct { ID uint `json:"id"` DownloadUrl string `json:"downloadUrl"` Protocol string `json:"protocol"` - Username string `json:"username"` - Password string `json:"password"` + Username string `json:"username" validate:"max=256"` + Password string `json:"password" validate:"max=256"` Auth bool `json:"auth"` } diff --git a/backend/app/dto/remote_db.go b/backend/app/dto/remote_db.go index aa859973e..d1a7db846 100644 --- a/backend/app/dto/remote_db.go +++ b/backend/app/dto/remote_db.go @@ -13,7 +13,7 @@ type RemoteDBSearch struct { type RemoteDBInfo struct { ID uint `json:"id"` CreatedAt time.Time `json:"createdAt"` - Name string `json:"name"` + Name string `json:"name" validate:"max=256"` From string `json:"from"` Version string `json:"version"` Address string `json:"address"` diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 1c0ca0d0c..710f59fad 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -181,6 +181,7 @@ const message = { appName: 'Support English, numbers, - and _, length 2-30, and cannot start and end with -_', containerName: 'Supports letters, numbers, underscores, hyphens and dots, cannot end with hyphen- or dot.1-127', + 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,', paramSimple: 'Support lowercase letters and numbers, length 1-128', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 0a85d6a0e..f54493ef1 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -179,6 +179,7 @@ const message = { nginxDoc: '僅支持英文大小寫,數字,和.', appName: '支持英文、數字、-和_,長度2-30,並且不能以-_開頭和結尾', containerName: '支持字母、數字、下劃線、連字符和點,不能以連字符-或點.結尾,長度1-127', + mirror: '支持以 http(s):// 開頭,英文大小寫,數字,. 和 - 的鏡像加速地址,且不能有空行', disableFunction: '僅支持字母、下劃線和,', leechExts: '僅支持字母數字和,', paramSimple: '支持小寫字母和數字,長度 1-128', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 583b3b929..ca19140e4 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -179,6 +179,7 @@ const message = { nginxDoc: '仅支持英文大小写,数字,和.', appName: '支持英文、数字、-和_,长度2-30,并且不能以-_开头和结尾', containerName: '支持字母、数字、下划线、连字符和点,不能以连字符-或点.结尾,长度1-127', + mirror: '支持以 http(s):// 开头,英文大小写,数字,. 和 - 的镜像加速地址,且不能有空行', disableFunction: '仅支持字母、下划线和,', leechExts: '仅支持字母数字和,', paramSimple: '支持小写字母和数字,长度1-128', diff --git a/frontend/src/views/container/setting/mirror/index.vue b/frontend/src/views/container/setting/mirror/index.vue index 32246c607..f81bf03f7 100644 --- a/frontend/src/views/container/setting/mirror/index.vue +++ b/frontend/src/views/container/setting/mirror/index.vue @@ -4,15 +4,22 @@ - + - + @@ -21,7 +28,7 @@