mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-08 02:36:01 +08:00
feat: Add the cleaning of the execution script (#8540)
This commit is contained in:
parent
4b5526a028
commit
3533eed5f4
2 changed files with 9 additions and 0 deletions
|
|
@ -279,6 +279,8 @@ func (u *DeviceService) Clean(req []dto.Clean) {
|
|||
_ = taskRepo.Delete(repo.WithByType(item.Name))
|
||||
}
|
||||
}
|
||||
case "script":
|
||||
dropFileOrDir(path.Join(global.Dir.TmpDir, "script", item.Name))
|
||||
case "images":
|
||||
dropImages()
|
||||
case "containers":
|
||||
|
|
@ -516,6 +518,11 @@ func loadLogTree(fileOp fileUtils.FileOp) []dto.CleanTree {
|
|||
list2 := loadTreeWithDir(false, "task_log", path2, fileOp)
|
||||
size2, _ := fileOp.GetDirSize(path2)
|
||||
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "task_log", Size: uint64(size2), Children: list2, Type: "task_log"})
|
||||
|
||||
path3 := path.Join(global.Dir.TmpDir, "script")
|
||||
list3 := loadTreeWithAllFile(true, path3, "script", path3, fileOp)
|
||||
size3, _ := fileOp.GetDirSize(path3)
|
||||
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "script", Size: uint64(size3), Children: list3, Type: "script", IsRecommend: true})
|
||||
return treeData
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -632,6 +632,8 @@ function load18n(label: string) {
|
|||
return i18n.global.t('clean.directory');
|
||||
case 'system_log':
|
||||
return i18n.global.t('clean.systemLog');
|
||||
case 'script':
|
||||
return i18n.global.t('cronjob.library.script');
|
||||
case 'docker_log':
|
||||
return i18n.global.t('clean.dockerLog');
|
||||
case 'task_log':
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue