mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 16:29:17 +08:00
fix: 解决同步快照路径错误的问题 (#1863)
This commit is contained in:
parent
7721395748
commit
2e73857b42
@ -282,7 +282,11 @@ func (u *BackupService) ListFiles(req dto.BackupSearchFile) ([]interface{}, erro
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return client.ListObjects("system_snapshot/")
|
prefix := "system_snapshot"
|
||||||
|
if len(backup.BackupPath) != 0 {
|
||||||
|
prefix = path.Join("/"+strings.TrimPrefix(backup.BackupPath, "/"), prefix)
|
||||||
|
}
|
||||||
|
return client.ListObjects(prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *BackupService) NewClient(backup *model.BackupAccount) (cloud_storage.CloudStorageClient, error) {
|
func (u *BackupService) NewClient(backup *model.BackupAccount) (cloud_storage.CloudStorageClient, error) {
|
||||||
|
@ -211,9 +211,6 @@ func (onedrive *oneDriveClient) ListObjects(prefix string) ([]interface{}, error
|
|||||||
if err := onedrive.client.Do(context.Background(), req, false, &driveItems); err != nil {
|
if err := onedrive.client.Do(context.Background(), req, false, &driveItems); err != nil {
|
||||||
return nil, fmt.Errorf("do request for list failed, err: %v", err)
|
return nil, fmt.Errorf("do request for list failed, err: %v", err)
|
||||||
}
|
}
|
||||||
for _, item := range driveItems.DriveItems {
|
|
||||||
return nil, fmt.Errorf("id: %v, name: %s \n", item.Id, item.Name)
|
|
||||||
}
|
|
||||||
|
|
||||||
var itemList []interface{}
|
var itemList []interface{}
|
||||||
for _, item := range driveItems.DriveItems {
|
for _, item := range driveItems.DriveItems {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user