From 9d65d2f4d6bd8c1c1e2ad8fb3594c77a9726b506 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Sat, 11 Mar 2023 17:50:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=BB=E6=9C=BA=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/v1/host.go | 8 ++- frontend/src/components/group/index.vue | 67 +++++++++++-------- frontend/src/global/form-rules.ts | 23 ++++++- frontend/src/lang/modules/en.ts | 1 + frontend/src/lang/modules/zh.ts | 2 + .../src/views/host/terminal/host/index.vue | 3 - .../host/terminal/host/operate/index.vue | 4 +- .../host/terminal/terminal/host-create.vue | 2 +- frontend/src/views/log/operation/index.vue | 2 +- .../setting/backup-account/operate/index.vue | 1 + 10 files changed, 74 insertions(+), 39 deletions(-) diff --git a/backend/app/api/v1/host.go b/backend/app/api/v1/host.go index b8a820eae..d7e69a53c 100644 --- a/backend/app/api/v1/host.go +++ b/backend/app/api/v1/host.go @@ -220,8 +220,12 @@ func (b *BaseApi) UpdateHost(c *gin.Context) { upMap["port"] = req.Port upMap["user"] = req.User upMap["auth_mode"] = req.AuthMode - upMap["password"] = req.Password - upMap["private_key"] = req.PrivateKey + if len(req.Password) != 0 { + upMap["password"] = req.Password + } + if len(req.PrivateKey) != 0 { + upMap["private_key"] = req.PrivateKey + } upMap["description"] = req.Description if err := hostService.Update(req.ID, upMap); err != nil { helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) diff --git a/frontend/src/components/group/index.vue b/frontend/src/components/group/index.vue index f8a77a42c..a14ad4b70 100644 --- a/frontend/src/components/group/index.vue +++ b/frontend/src/components/group/index.vue @@ -17,13 +17,18 @@ {{ row.name }} ({{ $t('website.default') }}) - + + + + + +