fix: Clear cache by specifying default values (#9154)

#8933
This commit is contained in:
2025-06-17 18:42:54 +08:00 committed by GitHub
parent 795223e7fa
commit 23a1fbdd4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,7 +51,7 @@ func (u *DeviceService) Scan() dto.CleanData {
ID: uuid.NewString(),
Label: "1panel_original",
Size: uint64(originalSize),
IsCheck: true,
IsCheck: originalSize > 0,
IsRecommend: true,
Type: "1panel_original",
Children: loadTreeWithDir(true, "1panel_original", originalPath, fileOp),
@ -86,7 +86,7 @@ func (u *DeviceService) Scan() dto.CleanData {
ID: uuid.NewString(),
Label: "snapshot",
Size: snapSize,
IsCheck: true,
IsCheck: snapSize > 0,
IsRecommend: true,
Type: "snapshot",
Children: snapTree,
@ -101,7 +101,7 @@ func (u *DeviceService) Scan() dto.CleanData {
ID: uuid.NewString(),
Label: "rollback",
Size: rollbackSize,
IsCheck: true,
IsCheck: rollbackSize > 0,
IsRecommend: true,
Type: "rollback",
Children: rollBackTree,
@ -127,7 +127,7 @@ func (u *DeviceService) Scan() dto.CleanData {
ID: uuid.NewString(),
Label: "unused",
Size: unusedSize,
IsCheck: true,
IsCheck: unusedSize > 0,
IsRecommend: true,
Type: "unused",
Children: unusedTree,