From 47cfa0c73087fd6cd96921ea56c1eb1ba9e84d07 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Wed, 13 Sep 2023 14:08:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=BF=AB=E7=85=A7?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#2270)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/snapshot_create.go | 3 ++- .../views/setting/snapshot/import/index.vue | 25 ++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/backend/app/service/snapshot_create.go b/backend/app/service/snapshot_create.go index f1ee11aa0..a601b1e76 100644 --- a/backend/app/service/snapshot_create.go +++ b/backend/app/service/snapshot_create.go @@ -194,7 +194,8 @@ func snapUpload(snap snapHelper, account string, file string) { _ = snapshotRepo.UpdateStatus(snap.Status.ID, map[string]interface{}{"upload": err.Error()}) return } - target := path.Join(backup.BackupPath, "system_snapshot", path.Base(file)) + target := path.Join(strings.TrimPrefix(backup.BackupPath, "/"), "system_snapshot", path.Base(file)) + global.LOG.Debugf("start upload snapshot to %s, dir: %s", backup.Type, target) if _, err := client.Upload(source, target); err != nil { snap.Status.Upload = err.Error() _ = snapshotRepo.UpdateStatus(snap.Status.ID, map[string]interface{}{"upload": err.Error()}) diff --git a/frontend/src/views/setting/snapshot/import/index.vue b/frontend/src/views/setting/snapshot/import/index.vue index c6d202247..a16c1a54f 100644 --- a/frontend/src/views/setting/snapshot/import/index.vue +++ b/frontend/src/views/setting/snapshot/import/index.vue @@ -1,10 +1,10 @@