(fileOp fileUtils.FileOp, recordMap map[string][]string)
| 378 | } |
| 379 | |
| 380 | func loadUnknownApps(fileOp fileUtils.FileOp, recordMap map[string][]string) dto.CleanTree { |
| 381 | apps, _ := appInstallRepo.ListBy(context.Background()) |
| 382 | var excludePaths []string |
| 383 | for _, app := range apps { |
| 384 | itemName := fmt.Sprintf("app/%s/%s", app.App.Key, app.Name) |
| 385 | if val, ok := recordMap[itemName]; ok { |
| 386 | for _, item := range val { |
| 387 | excludePaths = append(excludePaths, path.Join(global.Dir.LocalBackupDir, itemName, item)) |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | backupPath := path.Join(global.Dir.LocalBackupDir, "app") |
| 392 | treeData := dto.CleanTree{ |
| 393 | ID: uuid.NewString(), |
| 394 | Label: "unknown_app", |
| 395 | IsCheck: false, |
| 396 | IsRecommend: false, |
| 397 | CanDelete: false, |
| 398 | Name: backupPath, |
| 399 | Type: "unknown_backup", |
| 400 | } |
| 401 | _ = loadFileOrDirWithExclude(fileOp, 0, backupPath, &treeData, excludePaths) |
| 402 | return treeData |
| 403 | } |
| 404 | func loadUnknownDbs(fileOp fileUtils.FileOp, recordMap map[string][]string) dto.CleanTree { |
| 405 | dbs, _ := databaseRepo.GetList() |
| 406 | var excludePaths []string |
no test coverage detected