feat: add server log file management to performance settings

Add API endpoints (GET/DELETE /api/performance/logs) to list and clean up
server log files by count or by age. Track the active log file path in
the logger to prevent deleting the currently open log. Add a management
UI section in the performance settings page with log directory info,
file statistics, and cleanup controls. Includes i18n translations for
all supported languages (en, fr, ja, ru, vi, zh-CN, zh-TW).
This commit is contained in:
RedwindA
2026-03-21 20:06:49 +08:00
parent 42846c692e
commit e904579a5b
11 changed files with 467 additions and 0 deletions

View File

@@ -503,6 +503,10 @@
"保存邮箱域名白名单设置": "Save Email Domain Whitelist Settings",
"保存额度设置": "Save Quota Settings",
"保留原值(目标已有值时不覆盖)": "Keep original value (do not overwrite if target already has a value)",
"保留天数": "Days to Retain",
"保留文件数": "Files to Retain",
"保留最近N个文件": "Retain last N files",
"保留最近N天": "Retain last N days",
"修复数据库一致性": "Fix database consistency",
"修改为": "Modify to",
"修改子渠道优先级": "Modify sub-channel priority",
@@ -1116,8 +1120,10 @@
"将为选中的 ": "Will set for selected ",
"将仅保留第一个密钥文件,其余文件将被移除,是否继续?": "Only the first key file will be retained, and the remaining files will be removed. Continue?",
"将删除": "Deleting",
"将删除 {{value}} 天前的日志文件。": "Log files older than {{value}} days will be deleted.",
"将删除已使用、已禁用及过期的兑换码,此操作不可撤销。": "This will delete all used, disabled, and expired redemption codes, this operation cannot be undone.",
"将删除所有仍在内存中的渠道亲和性缓存条目。": "This will delete all channel affinity cache entries still in memory.",
"将只保留最近 {{value}} 个日志文件,其余将被删除。": "Only the last {{value}} log files will be retained; the rest will be deleted.",
"将大请求体临时存储到磁盘": "Store large request bodies temporarily on disk",
"将清除所有保存的配置并恢复默认设置,此操作不可撤销。是否继续?": "This will clear all saved configurations and restore default settings, this operation cannot be undone. Continue?",
"将清除选定时间之前的所有日志": "This will clear all logs before the selected time",
@@ -1202,6 +1208,7 @@
"已添加 {{count}} 个模板_one": "Added {{count}} template",
"已添加 {{count}} 个模板_other": "Added {{count}} templates",
"已添加到白名单": "Added to whitelist",
"已清理 {{count}} 个日志文件,释放 {{size}}": "Cleaned up {{count}} log files, freed {{size}}",
"已清空": "Cleared",
"已清空测试结果": "Cleared test results",
"已生成授权凭据": "Authorization credentials generated",
@@ -1570,8 +1577,12 @@
"日志已下载": "Logs downloaded",
"日志已加载": "Logs loaded",
"日志已复制到剪贴板": "Logs copied to clipboard",
"日志时间范围": "Log Date Range",
"日志总大小": "Total Log Size",
"日志文件数": "Log File Count",
"日志流": "Log Stream",
"日志清理失败:": "Log cleanup failed:",
"日志目录": "Log Directory",
"日志类型": "Log type",
"日志设置": "Log settings",
"日志详情": "Log details",
@@ -1690,6 +1701,8 @@
"服务可用性": "Service Status",
"服务商": "Service Provider",
"服务器地址": "Server Address",
"服务器日志功能未启用(未配置日志目录)": "Server logging is not enabled (log directory not configured)",
"服务器日志管理": "Server Log Management",
"服务显示名称": "Service Display Name",
"未匹配到模型,按回车键可将「{{name}}」作为自定义模型名添加": "No matching models. Press Enter to add \"{{name}}\" as a custom model name.",
"未发现新增模型": "No new models were added",
@@ -1986,6 +1999,8 @@
"添加额度": "Add quota",
"清理不活跃缓存": "Clean up inactive cache",
"清理失败": "Cleanup failed",
"清理方式": "Cleanup Mode",
"清理日志文件": "Clean Up Log Files",
"清空": "Clear",
"清空全部缓存": "Clear All Cache",
"清空该规则缓存": "Clear This Rule's Cache",
@@ -2186,6 +2201,7 @@
"确认操作": "Confirm Operation",
"确认新密码": "Confirm new password",
"确认清理不活跃的磁盘缓存?": "Confirm cleanup of inactive disk cache?",
"确认清理日志文件?": "Confirm log file cleanup?",
"确认清空全部渠道亲和性缓存": "Confirm clearing all channel affinity cache",
"确认清空该规则缓存": "Confirm clearing this rule's cache",
"确认清除历史日志": "Confirm clear historical logs",
@@ -2285,6 +2301,7 @@
"管理员设置了外部链接,点击下方按钮访问": "Administrator has set up external links, click the button below to access",
"管理员账号": "Admin account",
"管理员账号已经初始化过,请继续设置其他参数": "The admin account has already been initialized, please continue to set other parameters",
"管理服务器运行日志文件。日志文件会随运行时间不断累积,建议定期清理以释放磁盘空间。": "Manage server log files. Log files accumulate over time; regular cleanup is recommended to free disk space.",
"管理模型、标签、端点等预填组": "Manage model, tag, endpoint, etc. pre-filled groups",
"管理用户已绑定的第三方账户,支持筛选与解绑": "Manage users' linked third-party accounts, with filtering and unbinding support",
"管理绑定": "Manage Bindings",
@@ -2755,6 +2772,7 @@
"请输入新的部署名称": "Please enter new deployment name",
"请输入显示名称": "Please enter display name",
"请输入有效的JSON格式的请求体。您可以参考预览面板中的默认请求体格式。": "Please enter a valid JSON format request body. You can refer to the default request body format in the preview panel.",
"请输入有效的数值": "Please enter a valid value",
"请输入有效的数字": "Please enter a valid number",
"请输入有效的镜像地址": "Please enter a valid image address",
"请输入标签名称": "Please enter the tag name",