diff --git a/agent/app/service/device_clean.go b/agent/app/service/device_clean.go index 31559552c..89ffb440f 100644 --- a/agent/app/service/device_clean.go +++ b/agent/app/service/device_clean.go @@ -36,7 +36,6 @@ const ( tmpUploadPath = "1panel/tmp/upload" uploadPath = "1panel/uploads" downloadPath = "1panel/download" - logPath = "1panel/log" ) func (u *DeviceService) Scan() dto.CleanData { @@ -247,7 +246,7 @@ func (u *DeviceService) Clean(req []dto.Clean) { case "system_log": if len(item.Name) == 0 { - files, _ := os.ReadDir(path.Join(global.Dir.BaseDir, logPath)) + files, _ := os.ReadDir(global.Dir.LogDir) if len(files) == 0 { continue } @@ -255,14 +254,14 @@ func (u *DeviceService) Clean(req []dto.Clean) { if file.Name() == "1Panel-Core.log" || file.Name() == "1Panel.log" || file.IsDir() { continue } - dropFileOrDir(path.Join(global.Dir.BaseDir, logPath, file.Name())) + dropFileOrDir(path.Join(global.Dir.LogDir, file.Name())) } } else { - dropFileOrDir(path.Join(global.Dir.BaseDir, logPath, item.Name)) + dropFileOrDir(path.Join(global.Dir.LogDir, item.Name)) } case "task_log": if len(item.Name) == 0 { - files, _ := os.ReadDir(path.Join(global.Dir.BaseDir, logPath)) + files, _ := os.ReadDir(path.Join(global.Dir.TaskDir)) if len(files) == 0 { continue } @@ -270,11 +269,11 @@ func (u *DeviceService) Clean(req []dto.Clean) { if file.Name() == "ssl" || !file.IsDir() { continue } - dropFileOrDir(path.Join(global.Dir.BaseDir, logPath, file.Name())) + dropFileOrDir(path.Join(global.Dir.TaskDir, file.Name())) } _ = taskRepo.DeleteAll() } else { - pathItem := path.Join(global.Dir.BaseDir, logPath, item.Name) + pathItem := path.Join(global.Dir.TaskDir, item.Name) dropFileOrDir(pathItem) if len(item.Name) != 0 { _ = taskRepo.Delete(repo.WithByType(item.Name)) @@ -341,15 +340,14 @@ func systemClean(taskItem *task.Task) error { dropWithTask(path.Join(global.Dir.BaseDir, uploadPath), taskItem, &size, &fileCount) dropWithTask(path.Join(global.Dir.BaseDir, downloadPath), taskItem, &size, &fileCount) - logPath := path.Join(global.Dir.BaseDir, logPath) - logFiles, _ := os.ReadDir(logPath) + logFiles, _ := os.ReadDir(global.Dir.LogDir) if len(logFiles) != 0 { for i := 0; i < len(logFiles); i++ { if logFiles[i].IsDir() { continue } if logFiles[i].Name() != "1Panel.log" && logFiles[i].Name() != "1Panel-Core.log" { - dropWithTask(path.Join(logPath, logFiles[i].Name()), taskItem, &size, &fileCount) + dropWithTask(path.Join(global.Dir.LogDir, logFiles[i].Name()), taskItem, &size, &fileCount) } } } @@ -506,7 +504,7 @@ func loadDownloadTree(fileOp fileUtils.FileOp) []dto.CleanTree { func loadLogTree(fileOp fileUtils.FileOp) []dto.CleanTree { var treeData []dto.CleanTree - path1 := path.Join(global.Dir.BaseDir, logPath) + path1 := path.Join(global.Dir.LogDir) list1 := loadTreeWithAllFile(true, path1, "system_log", path1, fileOp) size := uint64(0) for _, file := range list1 { @@ -514,7 +512,7 @@ func loadLogTree(fileOp fileUtils.FileOp) []dto.CleanTree { } treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "system_log", Size: uint64(size), Children: list1, Type: "system_log", IsRecommend: true}) - path2 := path.Join(global.Dir.BaseDir, logPath) + path2 := path.Join(global.Dir.TaskDir) 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"}) @@ -575,7 +573,7 @@ func loadTreeWithDir(isCheck bool, treeType, pathItem string, fileOp fileUtils.F if treeType == "old_upgrade" { continue } - if treeType == "task_log" && file.Name() == "ssl" { + if file.Name() == "ssl" { continue } if file.IsDir() { diff --git a/core/i18n/lang/en.yaml b/core/i18n/lang/en.yaml index 88e9430ec..28f53da87 100644 --- a/core/i18n/lang/en.yaml +++ b/core/i18n/lang/en.yaml @@ -95,6 +95,7 @@ ScriptLibrary: "Script Library" Node: "Node" SyncNode: "Sync node data" +LocalName: "'local' name is only used for system local identification" SyncPackageData: "Package sync data [{{ .detail }}]" SyncPackageEncrypt: "Data package encryption" SyncRequest: "Request node sync API" diff --git a/core/i18n/lang/ja.yaml b/core/i18n/lang/ja.yaml index 19ab4419f..518e291d1 100644 --- a/core/i18n/lang/ja.yaml +++ b/core/i18n/lang/ja.yaml @@ -96,6 +96,7 @@ ScriptLibrary: "スクリプトライブラリ" Node: "ノード" SyncNode: "ノードデータ同期" +LocalName: "'local'名称はシステムのローカル識別のみに使用されます" SyncPackageData: "同期データのパッケージ化 [{{ .detail }}]" SyncPackageEncrypt: "データパッケージの暗号化" SyncRequest: "ノード同期APIをリクエスト" diff --git a/core/i18n/lang/ko.yaml b/core/i18n/lang/ko.yaml index 4649711fb..3cd889923 100644 --- a/core/i18n/lang/ko.yaml +++ b/core/i18n/lang/ko.yaml @@ -95,6 +95,7 @@ ScriptLibrary: "스크립트 라이브러리" Node: "노드" SyncNode: "노드 데이터 동기화" +LocalName: "'local' 이름은 시스템 로컬 식별 전용으로 사용됩니다" SyncPackageData: "동기화 데이터 패키징 [{{ .detail }}]" SyncPackageEncrypt: "데이터 패키지 암호화" SyncRequest: "노드 동기화 API 요청" diff --git a/core/i18n/lang/ms.yml b/core/i18n/lang/ms.yml index 871701e1b..bb914c12c 100644 --- a/core/i18n/lang/ms.yml +++ b/core/i18n/lang/ms.yml @@ -95,6 +95,7 @@ ScriptLibrary: "Pustaka Skrip" Node: "Nod" SyncNode: "Segerakkan data nod" +LocalName: "Nama 'local' hanya digunakan untuk pengenalpastian tempatan sistem" SyncPackageData: "Pakej data segerak [{{ .detail }}]" SyncPackageEncrypt: "Enkripsi pakej data" SyncRequest: "Permintaan API segerak nod" diff --git a/core/i18n/lang/pt-BR.yaml b/core/i18n/lang/pt-BR.yaml index 3846e2d02..70219e179 100644 --- a/core/i18n/lang/pt-BR.yaml +++ b/core/i18n/lang/pt-BR.yaml @@ -95,6 +95,7 @@ ScriptLibrary: "Biblioteca de Scripts" Node: "Nó" SyncNode: "Sincronizar dados do nó" +LocalName: "O nome 'local' é usado apenas para identificação local do sistema" SyncPackageData: "Empacotar dados de sincronização [{{ .detail }}]" SyncPackageEncrypt: "Criptografia de pacote de dados" SyncRequest: "Solicitar API de sincronização de nó" diff --git a/core/i18n/lang/ru.yaml b/core/i18n/lang/ru.yaml index 26eec4633..d1c7bb0b1 100644 --- a/core/i18n/lang/ru.yaml +++ b/core/i18n/lang/ru.yaml @@ -95,6 +95,7 @@ ScriptLibrary: "Библиотека скриптов" Node: "Узел" SyncNode: "Синхронизация данных узла" +LocalName: "Имя 'local' используется только для локальной идентификации в системе" SyncPackageData: "Упаковка данных синхронизации [{{ .detail }}]" SyncPackageEncrypt: "Шифрование пакета данных" SyncRequest: "Запрос API синхронизации узла" diff --git a/core/i18n/lang/zh-Hant.yaml b/core/i18n/lang/zh-Hant.yaml index 8317460d3..b3120bed8 100644 --- a/core/i18n/lang/zh-Hant.yaml +++ b/core/i18n/lang/zh-Hant.yaml @@ -95,6 +95,7 @@ ScriptLibrary: "腳本庫" Node: "節點" SyncNode: "同步節點數據" +LocalName: "'local' 名稱僅用於系統本機標識" SyncPackageData: "打包同步數據 [{{ .detail }}]" SyncPackageEncrypt: "數據包加密" SyncRequest: "請求節點同步接口" diff --git a/core/i18n/lang/zh.yaml b/core/i18n/lang/zh.yaml index 9aec301b6..d59bfd2b3 100644 --- a/core/i18n/lang/zh.yaml +++ b/core/i18n/lang/zh.yaml @@ -96,6 +96,7 @@ ScriptLibrary: "脚本库" #sync node Node: "节点" SyncNode: "同步节点数据" +LocalName: "local 名称仅用于系统本机标识" SyncPackageData: "打包同步数据 [{{ .detail }}]" SyncPackageEncrypt: "数据包加密" SyncRequest: "请求节点同步接口" diff --git a/frontend/src/components/port-jump/index.vue b/frontend/src/components/port-jump/index.vue index 3e4d3c813..9008dd155 100644 --- a/frontend/src/components/port-jump/index.vue +++ b/frontend/src/components/port-jump/index.vue @@ -16,7 +16,7 @@