From 5e8b23db6a1619641459413d61ee55b92600abb1 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:34:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BF=AB=E7=85=A7=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E5=BF=BD=E7=95=A5=E5=BA=94=E7=94=A8=E6=81=A2=E5=A4=8D=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E9=97=AE=E9=A2=98=20(#7012)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/clam.go | 3 +-- backend/app/service/image.go | 2 +- backend/app/service/snapshot.go | 11 +---------- frontend/src/components/upload/index.vue | 4 ++-- frontend/src/layout/components/AppFooter.vue | 2 +- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/backend/app/service/clam.go b/backend/app/service/clam.go index 885156d01..cb1b82a15 100644 --- a/backend/app/service/clam.go +++ b/backend/app/service/clam.go @@ -634,8 +634,7 @@ func handleAlert(stdout, clamName string, clamId uint) { lines := strings.Split(stdout, "\n") for _, line := range lines { if strings.HasPrefix(line, "Infected files: ") { - var infectedFiles = 0 - infectedFiles, _ = strconv.Atoi(strings.TrimPrefix(line, "Infected files: ")) + infectedFiles, _ := strconv.Atoi(strings.TrimPrefix(line, "Infected files: ")) if infectedFiles > 0 { pushAlert := dto.PushAlert{ TaskName: clamName, diff --git a/backend/app/service/image.go b/backend/app/service/image.go index 7c6e90570..f860df59e 100644 --- a/backend/app/service/image.go +++ b/backend/app/service/image.go @@ -432,7 +432,7 @@ func (u *ImageService) ImageRemove(req dto.BatchDelete) error { } defer client.Close() for _, id := range req.Names { - if _, err := client.ImageRemove(context.TODO(), id, types.ImageRemoveOptions{Force: req.Force, PruneChildren: true}); err != nil { + if _, err := client.ImageRemove(context.TODO(), id, image.RemoveOptions{Force: req.Force, PruneChildren: true}); err != nil { if strings.Contains(err.Error(), "image is being used") || strings.Contains(err.Error(), "is using") { if strings.Contains(id, "sha256:") { return buserr.New(constant.ErrObjectInUsed) diff --git a/backend/app/service/snapshot.go b/backend/app/service/snapshot.go index 082033085..75e24be0b 100644 --- a/backend/app/service/snapshot.go +++ b/backend/app/service/snapshot.go @@ -441,16 +441,7 @@ func rebuildAllAppInstall() error { go func(app model.AppInstall) { defer wg.Done() dockerComposePath := app.GetComposePath() - out, err := compose.Down(dockerComposePath) - if err != nil { - _ = handleErr(app, err, out) - return - } - out, err = compose.Up(dockerComposePath) - if err != nil { - _ = handleErr(app, err, out) - return - } + _, _ = compose.Up(dockerComposePath) app.Status = constant.Running _ = appInstallRepo.Save(context.Background(), &app) }(appInstalls[i]) diff --git a/frontend/src/components/upload/index.vue b/frontend/src/components/upload/index.vue index bac858635..4052ff72f 100644 --- a/frontend/src/components/upload/index.vue +++ b/frontend/src/components/upload/index.vue @@ -186,11 +186,11 @@ const acceptParams = async (params: DialogProps): Promise => { break; case 'website': title.value = name.value; - baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${detailName.value}/`; + baseDir.value = `${pathRes.data}/uploads/website/${type.value}/${detailName.value}/`; break; case 'app': title.value = name.value; - baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${name.value}/`; + baseDir.value = `${pathRes.data}/uploads/app/${type.value}/${name.value}/`; } upVisible.value = true; search(); diff --git a/frontend/src/layout/components/AppFooter.vue b/frontend/src/layout/components/AppFooter.vue index 83ed63f08..76ba5bcd1 100644 --- a/frontend/src/layout/components/AppFooter.vue +++ b/frontend/src/layout/components/AppFooter.vue @@ -2,7 +2,7 @@