From b54cbe1d111ba7eaa1084ed332c9e27c851fb45f Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Tue, 7 Mar 2023 15:43:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A7=A3=E5=86=B3=E5=9C=A8=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E8=A2=AB=E5=88=A0=E9=99=A4=E4=B9=8B=E5=90=8E=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E5=BA=94=E7=94=A8=E7=8A=B6=E6=80=81=E4=B8=8D=E5=AF=B9?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/app_install.go | 10 +++---- backend/app/service/app_utils.go | 1 + .../src/views/app-store/installed/index.vue | 5 +++- .../src/views/host/file-management/index.vue | 30 ++++++++++--------- .../src/views/website/ssl/create/index.vue | 13 ++------ .../website/config/basic/https/index.vue | 2 +- 6 files changed, 29 insertions(+), 32 deletions(-) diff --git a/backend/app/service/app_install.go b/backend/app/service/app_install.go index 84b05850e..a15b69ab2 100644 --- a/backend/app/service/app_install.go +++ b/backend/app/service/app_install.go @@ -164,25 +164,25 @@ func (a AppInstallService) Operate(req request.AppInstalledOperate) error { if err != nil { return handleErr(install, err, out) } - return nil + return syncById(install.ID) case constant.Start: out, err := compose.Start(dockerComposePath) if err != nil { return handleErr(install, err, out) } - install.Status = constant.Running + return syncById(install.ID) case constant.Stop: out, err := compose.Stop(dockerComposePath) if err != nil { return handleErr(install, err, out) } - install.Status = constant.Stopped + return syncById(install.ID) case constant.Restart: out, err := compose.Restart(dockerComposePath) if err != nil { return handleErr(install, err, out) } - install.Status = constant.Running + return syncById(install.ID) case constant.Delete: tx, ctx := getTxAndContext() if err := deleteAppInstall(ctx, install, req.DeleteBackup, req.ForceDelete, req.DeleteDB); err != nil && !req.ForceDelete { @@ -198,8 +198,6 @@ func (a AppInstallService) Operate(req request.AppInstalledOperate) error { default: return errors.New("operate not support") } - - return appInstallRepo.Save(&install) } func (a AppInstallService) SyncAll() error { diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go index 0b8ae6742..34c35c440 100644 --- a/backend/app/service/app_utils.go +++ b/backend/app/service/app_utils.go @@ -401,6 +401,7 @@ func handleErr(install model.AppInstall, err error, out string) error { if out != "" { install.Message = out reErr = errors.New(out) + install.Status = constant.Error } _ = appInstallRepo.Save(&install) return reErr diff --git a/frontend/src/views/app-store/installed/index.vue b/frontend/src/views/app-store/installed/index.vue index ae96eb6f2..aeb623180 100644 --- a/frontend/src/views/app-store/installed/index.vue +++ b/frontend/src/views/app-store/installed/index.vue @@ -296,6 +296,9 @@ const operate = async () => { MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); search(); }) + .catch(() => { + search(); + }) .finally(() => { loading.value = false; }); @@ -398,7 +401,7 @@ onMounted(() => { search(); timer = setInterval(() => { search(); - }, 1000 * 8); + }, 10000 * 6); }); onUnmounted(() => { diff --git a/frontend/src/views/host/file-management/index.vue b/frontend/src/views/host/file-management/index.vue index 9584ecafc..52ce62efe 100644 --- a/frontend/src/views/host/file-management/index.vue +++ b/frontend/src/views/host/file-management/index.vue @@ -43,20 +43,22 @@ - {{ $t('file.upload') }} - {{ $t('file.remoteFile') }} - - {{ $t('file.copy') }} - - - {{ $t('file.move') }} - - - {{ $t('file.compress') }} - - - {{ $t('file.download') }} - + + {{ $t('file.upload') }} + {{ $t('file.remoteFile') }} + + {{ $t('file.copy') }} + + + {{ $t('file.move') }} + + + {{ $t('file.compress') }} + + + {{ $t('file.download') }} + +