Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions agent/app/service/device_clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ func loadBackupTree(fileOp fileUtils.FileOp) []dto.CleanTree {
treeData = append(treeData, loadUnknownDbs(fileOp, recordMap))
treeData = append(treeData, loadUnknownWebsites(fileOp, recordMap))
treeData = append(treeData, loadUnknownSnapshot(fileOp))
treeData = append(treeData, loadUnknownWebsiteLog(fileOp, recordMap))
return treeData
}

Expand Down Expand Up @@ -506,6 +507,44 @@ func loadUnknownSnapshot(fileOp fileUtils.FileOp) dto.CleanTree {
return treeData
}

func loadUnknownWebsiteLog(fileOp fileUtils.FileOp, recordMap map[string][]string) dto.CleanTree {
treeData := dto.CleanTree{
ID: uuid.NewString(),
Label: "unknown_website_log",
IsCheck: false,
IsRecommend: true,
Type: "unknown_backup",
}
dir := path.Join(global.Dir.LocalBackupDir, "log/website")
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 {
dirPath := path.Join(dir, dirName)
itemSize, _ := fileOp.GetDirSize(dirPath)
childData := dto.CleanTree{
ID: uuid.NewString(),
Label: dirName,
IsCheck: true,
IsRecommend: true,
Name: dirPath,
Type: "unknown_backup",
Size: uint64(itemSize),
}
treeData.Size += uint64(itemSize)
treeData.Children = append(treeData.Children, childData)
}
}
if treeData.Size > 0 {
treeData.IsCheck = true
}
return treeData
}

func loadFileOrDirWithExclude(fileOp fileUtils.FileOp, index uint, dir string, rootTree *dto.CleanTree, excludes []string) error {
index++
entries, err := os.ReadDir(dir)
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2235,6 +2235,7 @@ const message = {
buildCache: 'Container Build Cache',

appTmpDownload: 'App temporary download file',
unknownWebsiteLog: 'Unlinked website log backup file',
},
app: {
app: 'Application | Applications',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/es-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,7 @@ const message = {
buildCache: 'Caché de build de contenedores',

appTmpDownload: 'Archivo de descarga temporal de la aplicación',
unknownWebsiteLog: 'Archivo de respaldo de registro de sitio web no vinculado',
},
app: {
app: 'Aplicación | Aplicaciones',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,7 @@ const message = {
buildCache: 'コンテナビルドキャッシュ',

appTmpDownload: 'Archivo de descarga temporal de la aplicación',
unknownWebsiteLog: '未関連ウェブサイトログバックアップファイル',
},
app: {
app: 'アプリケーション|アプリケーション',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2119,6 +2119,7 @@ const message = {
buildCache: '컨테이너 빌드 캐시',

appTmpDownload: '앱 임시 다운로드 파일',
unknownWebsiteLog: '연결되지 않은 웹사이트 로그 백업 파일',
},
app: {
app: '애플리케이션 | 애플리케이션들',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2214,6 +2214,7 @@ const message = {
buildCache: 'Cache Pembinaan Kontena',

appTmpDownload: 'Fail muat turun sementara aplikasi',
unknownWebsiteLog: 'Fail sandaran log laman web tidak dikaitkan',
},
app: {
app: 'Aplikasi | Aplikasi',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2208,6 +2208,7 @@ const message = {
buildCache: 'Cache de construção do container',

appTmpDownload: 'Arquivo de download temporário do aplicativo',
unknownWebsiteLog: 'Fail sandaran log laman web tidak dikaitkan',
},
app: {
app: 'Aplicativo | Aplicativos',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2203,6 +2203,7 @@ const message = {
buildCache: 'Кэш сборки контейнеров',

appTmpDownload: 'Временный файл загрузки приложения',
unknownWebsiteLog: 'Arquivo de backup de log de site não vinculado',
},
app: {
app: 'Приложение | Приложения',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2260,6 +2260,7 @@ const message = {
buildCache: 'Konteyner Oluşturma Önbelleği',

appTmpDownload: 'Uygulama geçici indirme dosyası',
unknownWebsiteLog: 'Bağlantısız web sitesi günlük yedekleme dosyası',
},
app: {
app: 'Uygulama | Uygulamalar',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,7 @@ const message = {
buildCache: '容器建置快取',

appTmpDownload: '應用程式暫存下載檔案',
unknownWebsiteLog: '未關聯網站日誌備份檔案',
},
app: {
app: '應用',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2081,6 +2081,7 @@ const message = {
buildCache: '构建缓存',

appTmpDownload: '应用临时下载文件',
unknownWebsiteLog: '未关联网站日志备份文件',
},
app: {
app: '应用',
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/views/toolbox/clean/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ const loadSubmitCheck = (data: any) => {
item.label !== 'unknown_database' &&
item.label !== 'unknown_website' &&
item.label !== 'unknown_snapshot' &&
item.label !== 'unknown_website_log' &&
item.type !== 'app_tmp_download'
) {
submitCleans.value.push({ treeType: item.type, name: item.name, size: item.size });
Expand Down Expand Up @@ -636,6 +637,8 @@ function load18n(label: string) {
return i18n.global.t('logs.websiteLog');
case 'app_tmp_download':
return i18n.global.t('clean.appTmpDownload');
case 'unknown_website_log':
return i18n.global.t('clean.unknownWebsiteLog');
default:
return label;
}
Expand Down
Loading