MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / loadDownloadTree

Function loadDownloadTree

agent/app/service/device_clean.go:631–659  ·  view source on GitHub ↗
(fileOp fileUtils.FileOp)

Source from the content-addressed store, hash-verified

629}
630
631func loadDownloadTree(fileOp fileUtils.FileOp) []dto.CleanTree {
632 var treeData []dto.CleanTree
633 treeData = loadTreeWithCheck(treeData, path.Join(global.Dir.BaseDir, downloadPath, "app"), "download_app", fileOp)
634 treeData = loadTreeWithCheck(treeData, path.Join(global.Dir.BaseDir, downloadPath, "website"), "download_website", fileOp)
635 treeData = loadTreeWithCheck(treeData, path.Join(global.Dir.BaseDir, downloadPath, "database"), "download_database", fileOp)
636
637 path5 := path.Join(global.Dir.BaseDir, downloadPath)
638 uploadTreeData := loadTreeWithAllFile(true, path5, "download", path5, fileOp)
639 treeData = append(treeData, uploadTreeData...)
640
641 appTmpDownloadTree := loadAppTmpDownloadTree(fileOp)
642 if len(appTmpDownloadTree) > 0 {
643 parentTree := dto.CleanTree{
644 ID: uuid.NewString(),
645 Label: "app_tmp_download",
646 IsCheck: true,
647 IsRecommend: true,
648 CanDelete: false,
649 Type: "app_tmp_download",
650 Name: "apps",
651 }
652 for _, child := range appTmpDownloadTree {
653 parentTree.Size += child.Size
654 }
655 parentTree.Children = appTmpDownloadTree
656 treeData = append(treeData, parentTree)
657 }
658 return treeData
659}
660
661func loadLogTree(fileOp fileUtils.FileOp) []dto.CleanTree {
662 var treeData []dto.CleanTree

Callers 1

ScanMethod · 0.85

Calls 3

loadTreeWithCheckFunction · 0.85
loadTreeWithAllFileFunction · 0.85
loadAppTmpDownloadTreeFunction · 0.85

Tested by

no test coverage detected