From 986cb8f3cdce9f62d2a65ef8b02815ec5db05800 Mon Sep 17 00:00:00 2001 From: ch8o <9103372+ch8o@users.noreply.github.com> Date: Thu, 22 Jul 2021 14:30:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E9=92=A5=E5=90=8E=EF=BC=8Cagent=E8=BF=9E=E4=B8=8D?= =?UTF-8?q?=E4=B8=8Abug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/dashboard/controller/member_api.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/dashboard/controller/member_api.go b/cmd/dashboard/controller/member_api.go index b747cdc426..f67c49c28c 100644 --- a/cmd/dashboard/controller/member_api.go +++ b/cmd/dashboard/controller/member_api.go @@ -174,7 +174,9 @@ func (ma *memberAPI) addOrEditServer(c *gin.Context) { dao.ServerLock.RLock() s.Host = dao.ServerList[s.ID].Host s.State = dao.ServerList[s.ID].State + dao.SecretToID[s.Secret] = s.ID dao.ServerList[s.ID] = &s + delete(dao.SecretToID, dao.ServerList[s.ID].Secret) dao.ServerLock.RUnlock() } else { s.Host = &model.Host{} From 2abcbe6b9429b758fa6f4e6ddfb11e4010d68223 Mon Sep 17 00:00:00 2001 From: ch8o <9103372+ch8o@users.noreply.github.com> Date: Thu, 22 Jul 2021 15:27:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E9=92=A5=E5=90=8E=EF=BC=8Cagent=E8=BF=9E=E4=B8=8D?= =?UTF-8?q?=E4=B8=8Abug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/dashboard/controller/member_api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/dashboard/controller/member_api.go b/cmd/dashboard/controller/member_api.go index f67c49c28c..a5fe35995b 100644 --- a/cmd/dashboard/controller/member_api.go +++ b/cmd/dashboard/controller/member_api.go @@ -175,8 +175,8 @@ func (ma *memberAPI) addOrEditServer(c *gin.Context) { s.Host = dao.ServerList[s.ID].Host s.State = dao.ServerList[s.ID].State dao.SecretToID[s.Secret] = s.ID - dao.ServerList[s.ID] = &s delete(dao.SecretToID, dao.ServerList[s.ID].Secret) + dao.ServerList[s.ID] = &s dao.ServerLock.RUnlock() } else { s.Host = &model.Host{}