feat: add log page status filter

This commit is contained in:
engigu
2026-02-28 08:40:14 +08:00
parent 22e3e89ba0
commit dd8a887399
4 changed files with 43 additions and 8 deletions
+4
View File
@@ -21,6 +21,7 @@ func (lc *LogController) GetLogs(c *gin.Context) {
p := utils.ParsePagination(c)
taskID, _ := strconv.Atoi(c.DefaultQuery("task_id", "0"))
taskName := c.DefaultQuery("task_name", "")
status := c.DefaultQuery("status", "")
var logs []models.TaskLog
var total int64
@@ -29,6 +30,9 @@ func (lc *LogController) GetLogs(c *gin.Context) {
if taskID > 0 {
query = query.Where("task_id = ?", taskID)
}
if status != "" {
query = query.Where("status = ?", status)
}
// 按任务名称过滤
if taskName != "" {