mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 16:00:51 +00:00
fix: Fixed issue with website log display error in clean cache (#11607)
This commit is contained in:
@@ -497,14 +497,19 @@ func loadUnknownWebsiteLog(fileOp fileUtils.FileOp, recordMap map[string][]strin
|
||||
Type: "unknown_backup",
|
||||
}
|
||||
dir := path.Join(global.Dir.LocalBackupDir, "log/website")
|
||||
websites, _ := websiteRepo.List()
|
||||
websiteMap := make(map[string]struct{})
|
||||
for _, website := range websites {
|
||||
websiteMap[website.Alias] = struct{}{}
|
||||
}
|
||||
|
||||
entries, _ := os.ReadDir(dir)
|
||||
for _, entry := range entries {
|
||||
if !entry.IsDir() {
|
||||
continue
|
||||
}
|
||||
dirName := entry.Name()
|
||||
itemName := fmt.Sprintf("log/website/%s", dirName)
|
||||
if _, ok := recordMap[itemName]; !ok {
|
||||
if _, ok := websiteMap[dirName]; !ok {
|
||||
dirPath := path.Join(dir, dirName)
|
||||
itemSize, _ := fileOp.GetDirSize(dirPath)
|
||||
childData := dto.CleanTree{
|
||||
|
||||
@@ -402,8 +402,11 @@ const loadSubmitCheck = (data: any) => {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for (const item of data) {
|
||||
if (item.label === 'unknown_website_log' && item.isCheck && item.children) {
|
||||
loadSubmitCheck(item.children);
|
||||
continue;
|
||||
}
|
||||
if (item.isCheck && item.type !== 'app_tmp_download') {
|
||||
submitCleans.value.push({ treeType: item.type, name: item.name, size: item.size });
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user