mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-15 02:57:38 +08:00
parent
1ade1b8d8b
commit
34b80373c7
10 changed files with 33 additions and 4 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/agent/constant"
|
||||
"github.com/1Panel-dev/1Panel/agent/i18n"
|
||||
"github.com/1Panel-dev/1Panel/agent/utils/docker"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/build"
|
||||
|
@ -307,7 +308,7 @@ func doSystemClean(taskItem *task.Task) func(t *task.Task) error {
|
|||
}
|
||||
timeNow := time.Now().Format(constant.DateTimeLayout)
|
||||
if fileCount != 0 {
|
||||
taskItem.LogSuccessF("%s: total clean: %s, total count: %d", timeNow, common.LoadSizeUnit2F(float64(size)), fileCount)
|
||||
taskItem.Log(i18n.GetMsgWithMap("FileDropSum", map[string]interface{}{"size": common.LoadSizeUnit2F(float64(size)), "count": fileCount}))
|
||||
}
|
||||
|
||||
_ = settingRepo.Update("LastCleanTime", timeNow)
|
||||
|
@ -587,7 +588,6 @@ func dropVolumes() {
|
|||
func dropWithExclude(pathToDelete string, excludeSubDirs []string, taskItem *task.Task, size *int64, count *int) {
|
||||
entries, err := os.ReadDir(pathToDelete)
|
||||
if err != nil {
|
||||
taskItem.LogFailed(fmt.Sprintf("read dir %s failed: %v", pathToDelete, err))
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -615,11 +615,11 @@ func dropWithTask(itemPath string, taskItem *task.Task, size *int64, count *int)
|
|||
*size += itemSize
|
||||
*count += itemCount
|
||||
if err := os.RemoveAll(itemPath); err != nil {
|
||||
taskItem.LogFailed(fmt.Sprintf("drop file %s, err %v", itemPath, err))
|
||||
taskItem.Log(i18n.GetMsgWithDetail("FileDropFailed", err.Error()))
|
||||
return
|
||||
}
|
||||
if itemCount != 0 {
|
||||
taskItem.LogSuccessF("drop file %s, size: %s, count: %d", itemPath, common.LoadSizeUnit2F(float64(itemSize)), itemCount)
|
||||
taskItem.Log(i18n.GetMsgWithMap("FileDropSuccess", map[string]interface{}{"count": itemCount, "size": common.LoadSizeUnit2F(float64(itemSize))}))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -108,6 +108,9 @@ ErrFavoriteExist: 'This path has already been favorited'
|
|||
ErrInvalidChar: 'Illegal characters are not allowed'
|
||||
ErrPathNotDelete: 'The selected directory cannot be deleted'
|
||||
ErrLogFileToLarge: "The log file exceeds 500MB and cannot be opened"
|
||||
FileDropFailed: "File cleanup failed {{ .detail }}"
|
||||
FileDropSuccess: "File cleanup successful, cleaned {{ .count }} files, freed {{ .size }} disk space"
|
||||
FileDropSum: "File cleanup completed successfully, total {{ .count }} files cleaned, total {{ .size }} disk space freed"
|
||||
|
||||
#website
|
||||
ErrAliasIsExist: 'Alias already exists'
|
||||
|
|
|
@ -108,6 +108,9 @@ ErrFavoriteExist: 'このパスはすでにお気に入りに登録されてい
|
|||
ErrInvalidChar: '不正な文字は許可されません'
|
||||
ErrPathNotDelete: '選択されたディレクトリは削除できません'
|
||||
ErrLogFileToLarge: "ログファイルが500MBを超えており、開くことができません"
|
||||
FileDropFailed: "ファイルのクリーンアップに失敗しました {{ .detail }}"
|
||||
FileDropSuccess: "ファイルのクリーンアップ成功、{{ .count }} ファイルを削除、{{ .size }} のディスク領域を解放"
|
||||
FileDropSum: "ファイルのクリーンアップが完了しました、合計 {{ .count }} ファイルを削除、合計 {{ .size }} のディスク領域を解放"
|
||||
|
||||
#website
|
||||
ErrAliasIsExist: 'エイリアスがすでに存在します'
|
||||
|
|
|
@ -108,6 +108,9 @@ ErrFavoriteExist: '이 경로는 이미 즐겨찾기되었습니다'
|
|||
ErrInvalidChar: '불법 문자는 허용되지 않습니다'
|
||||
ErrPathNotDelete: '선택한 디렉토리를 삭제할 수 없습니다'
|
||||
ErrLogFileToLarge: "로그 파일이 500MB를 초과하여 열 수 없습니다"
|
||||
FileDropFailed: "파일 정리 실패 {{ .detail }}"
|
||||
FileDropSuccess: "파일 정리 성공, {{ .count }}개 파일 삭제, {{ .size }} 디스크 공간 확보"
|
||||
FileDropSum: "파일 정리 완료, 총 {{ .count }}개 파일 삭제, 총 {{ .size }} 디스크 공간 확보"
|
||||
|
||||
#웹사이트
|
||||
ErrAliasIsExist: '별칭이 이미 존재합니다'
|
||||
|
|
|
@ -107,6 +107,10 @@ ErrSourcePathNotFound: 'Direktori sumber tidak wujud'
|
|||
ErrFavoriteExist: 'Laluan ini telah digemari'
|
||||
ErrInvalidChar: 'Aksara haram tidak dibenarkan'
|
||||
ErrPathNotDelete: 'Direktori yang dipilih tidak boleh dipadamkan'
|
||||
ErrLogFileTooLarge: "Fail log melebihi 500MB dan tidak boleh dibuka"
|
||||
FileDropFailed: "Pembersihan fail gagal {{ .detail }}"
|
||||
FileDropSuccess: "Pembersihan fail berjaya, {{ .count }} fail dibersihkan, {{ .size }} ruang cakera dibebaskan"
|
||||
FileDropSum: "Pembersihan fail selesai, sejumlah {{ .count }} fail dibersihkan, sejumlah {{ .size }} ruang cakera dibebaskan"
|
||||
|
||||
#laman web
|
||||
ErrAliasIsExist: 'Alias sudah wujud'
|
||||
|
|
|
@ -108,6 +108,9 @@ ErrFavoriteExist: 'Este caminho já foi favorito'
|
|||
ErrInvalidChar: 'Caracteres ilegais não são permitidos'
|
||||
ErrPathNotDelete: 'O diretório selecionado não pode ser excluído'
|
||||
ErrLogFileToLarge: "Fail log melebihi 500MB, tidak boleh dibuka"
|
||||
FileDropFailed: "Falha na limpeza de arquivos {{ .detail }}"
|
||||
FileDropSuccess: "Limpeza de arquivos bem-sucedida, {{ .count }} arquivos removidos, {{ .size }} de espaço em disco liberado"
|
||||
FileDropSum: "Limpeza de arquivos concluída com sucesso, total de {{ .count }} arquivos removidos, total de {{ .size }} de espaço em disco liberado"
|
||||
|
||||
#site
|
||||
ErrAliasIsExist: 'Alias já existe'
|
||||
|
|
|
@ -108,6 +108,9 @@ ErrFavoriteExist: 'Этот путь уже добавлен в избранно
|
|||
ErrInvalidChar: 'Недопустимые символы не допускаются'
|
||||
ErrPathNotDelete: 'Выбранный каталог не может быть удален'
|
||||
ErrLogFileToLarge: "Файл журнала превышает 500MB и не может быть открыт"
|
||||
FileDropFailed: "Очистка файлов не удалась {{ .detail }}"
|
||||
FileDropSuccess: "Очистка файлов успешна, удалено {{ .count }} файлов, освобождено {{ .size }} дискового пространства"
|
||||
FileDropSum: "Очистка файлов завершена успешно, всего удалено {{ .count }} файлов, освобождено {{ .size }} дискового пространства"
|
||||
|
||||
#веб-сайт
|
||||
ErrAliasIsExist: 'Псевдоним уже существует'
|
||||
|
|
|
@ -108,6 +108,10 @@ ErrFavoriteExist: 'Bu yol zaten favorilere eklendi'
|
|||
ErrInvalidChar: 'Yasak karakterlere izin verilmiyor'
|
||||
ErrPathNotDelete: 'Seçilen dizin silinemez'
|
||||
ErrLogFileToLarge: "Günlük dosyası 500MB'ı aşıyor ve açılamıyor"
|
||||
FileDropFailed: "Dosya temizleme başarısız {{ .detail }}"
|
||||
FileDropSuccess: "Dosya temizleme başarılı, {{ .count }} dosya silindi, {{ .size }} disk alanı boşaltıldı"
|
||||
FileDropSum: "Dosya temizleme tamamlandı, toplam {{ .count }} dosya silindi, toplam {{ .size }} disk alanı boşaltıldı"
|
||||
|
||||
|
||||
#website
|
||||
ErrAliasIsExist: 'Takma ad zaten mevcut'
|
||||
|
|
|
@ -107,6 +107,9 @@ ErrFavoriteExist: '已收藏此路徑'
|
|||
ErrInvalidChar: '禁止使用非法字元'
|
||||
ErrPathNotDelete: '所選目錄不可刪除'
|
||||
ErrLogFileToLarge: "日志文件超过 500M,無法打開"
|
||||
FileDropFailed: "文件清理失敗 {{ .detail }}"
|
||||
FileDropSuccess: "文件清理成功,清理 {{ .count }} 個文件,釋放 {{ .size }} 磁碟空間"
|
||||
FileDropSum: "文件清理完成,共清理 {{ .count }} 個文件,共釋放 {{ .size }} 磁碟空間"
|
||||
|
||||
#website
|
||||
ErrAliasIsExist: '代號已存在'
|
||||
|
|
|
@ -107,6 +107,9 @@ ErrFavoriteExist: "已收藏此路径"
|
|||
ErrInvalidChar: "禁止使用非法字符"
|
||||
ErrPathNotDelete: "所选目录不可删除"
|
||||
ErrLogFileToLarge: "日志文件超过 500M,无法打开"
|
||||
FileDropFailed: "文件清理失败 {{ .detail }}"
|
||||
FileDropSuccess: "文件清理成功,清理文件 {{ .count }},释放磁盘空间 {{ .size }}"
|
||||
FileDropSum: "文件清理成功,清理文件共计 {{ .count }},释放磁盘空间共计 {{ .size }}"
|
||||
|
||||
#website
|
||||
ErrAliasIsExist: "代号已存在"
|
||||
|
|
Loading…
Add table
Reference in a new issue