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') }}) - + + + + + +