From ccee45111871d53e00e613991b3946d779db55ea Mon Sep 17 00:00:00 2001 From: ssongliu Date: Mon, 20 Feb 2023 15:39:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E5=BA=93=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=BA=9B=20loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/v1/terminal.go | 12 ++++----- .../src/views/database/mysql/backup/index.vue | 27 ++++++++++++++----- .../views/database/mysql/setting/index.vue | 2 +- .../mysql/setting/variables/index.vue | 2 +- .../src/views/database/mysql/upload/index.vue | 20 +++++++++----- frontend/src/views/database/redis/index.vue | 5 +++- .../views/database/redis/setting/index.vue | 2 +- .../views/host/terminal/terminal/terminal.vue | 4 +-- frontend/vite.config.ts | 2 +- 9 files changed, 51 insertions(+), 25 deletions(-) diff --git a/backend/app/api/v1/terminal.go b/backend/app/api/v1/terminal.go index 1f69d5c55..cb49e8a13 100644 --- a/backend/app/api/v1/terminal.go +++ b/backend/app/api/v1/terminal.go @@ -90,6 +90,12 @@ func (b *BaseApi) RedisWsSsh(c *gin.Context) { helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) return } + redisConf, err := redisService.LoadConf() + if err != nil { + global.LOG.Errorf("load redis container failed, err: %v", err) + helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) + return + } wsConn, err := upGrader.Upgrade(c.Writer, c.Request, nil) if err != nil { @@ -97,12 +103,6 @@ func (b *BaseApi) RedisWsSsh(c *gin.Context) { return } defer wsConn.Close() - - redisConf, err := redisService.LoadConf() - if err != nil { - helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) - return - } auth := "" if len(redisConf.Requirepass) != 0 { auth = fmt.Sprintf("-a %s --no-auth-warning", redisConf.Requirepass) diff --git a/frontend/src/views/database/mysql/backup/index.vue b/frontend/src/views/database/mysql/backup/index.vue index 1a87e0ec0..e39175eab 100644 --- a/frontend/src/views/database/mysql/backup/index.vue +++ b/frontend/src/views/database/mysql/backup/index.vue @@ -1,5 +1,5 @@