feat: support sorting tasks and exit dialogs on ESC key (#148)

This commit is contained in:
duorameng
2026-07-13 08:42:18 +08:00
parent 0983cf1a38
commit ad5939bdb9
6 changed files with 144 additions and 21 deletions
+5 -2
View File
@@ -337,7 +337,10 @@ func (tc *TaskController) GetTasks(c *gin.Context) {
agentID = &agentIDStr
}
tasks, total := tc.taskService.GetTasksWithPagination(p.Page, p.PageSize, name, agentID, tags, taskType)
sortBy := c.DefaultQuery("sort_by", "")
order := c.DefaultQuery("order", "")
tasks, total := tc.taskService.GetTasksWithPagination(p.Page, p.PageSize, name, agentID, tags, taskType, sortBy, order)
utils.PaginatedResponse(c, vo.ToTaskVOListFromModels(tasks), total, p)
}
@@ -702,7 +705,7 @@ func (tc *TaskController) BatchDeleteByQuery(c *gin.Context) {
agentID = &agentIDStr
}
tasks, _ := tc.taskService.GetTasksWithPagination(1, 999999, name, agentID, tags, taskType)
tasks, _ := tc.taskService.GetTasksWithPagination(1, 999999, name, agentID, tags, taskType, "", "")
if len(tasks) == 0 {
utils.Success(c, gin.H{"count": 0})
return