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
+2
View File
@@ -194,6 +194,8 @@ func SetApiRouter(router *gin.Engine) {
performanceRoute.DELETE("/disk_cache", controller.ClearDiskCache)
performanceRoute.POST("/reset_stats", controller.ResetPerformanceStats)
performanceRoute.POST("/gc", controller.ForceGC)
performanceRoute.GET("/logs", controller.GetLogFiles)
performanceRoute.DELETE("/logs", controller.CleanupLogFiles)
}
ratioSyncRoute := apiRouter.Group("/ratio_sync")
ratioSyncRoute.Use(middleware.RootAuth())