2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 16:10:59 +08:00

feat: 日志只读取 1000 行

This commit is contained in:
耗子
2023-10-29 16:17:37 +08:00
parent 83ebe763d2
commit 2202e1a8a2
2 changed files with 4 additions and 2 deletions

View File

@@ -273,5 +273,7 @@ func (c *CronController) Log(ctx http.Context) http.Response {
return Error(ctx, http.StatusUnprocessableEntity, "日志文件不存在")
}
return Success(ctx, tools.Read(cron.Log))
log := tools.Exec("tail -n 1000 " + cron.Log)
return Success(ctx, log)
}

View File

@@ -62,7 +62,7 @@ func (r *TaskController) Log(ctx http.Context) http.Response {
return Error(ctx, http.StatusInternalServerError, "系统内部错误")
}
log := tools.Read(task.Log)
log := tools.Exec("tail -n 1000 " + task.Log)
return Success(ctx, log)
}