mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-29 04:08:12 +08:00
Go: Admin list ingestion tasks (#14695)
### What problem does this PR solve? ``` RAGFlow(admin)> list tasks; +-------------+------------------+----------------------------------+-------------+-----------+----------------------------------+----------+----------------------+-------------+-----------+---------+ | chunk_count | digest | document_id | duration | from_page | id | priority | progress | retry_count | task_type | to_page | +-------------+------------------+----------------------------------+-------------+-----------+----------------------------------+----------+----------------------+-------------+-----------+---------+ | 16 | 8a0016a0dc3cbdbb | f6aa38bb4ad111f1ba6338a74640adcc | 1511.156966 | 0 | f91e4f104ad111f1aaaf38a74640adcc | 0 | 1 | 1 | | 12 | +-------------+------------------+----------------------------------+-------------+-----------+----------------------------------+----------+----------------------+-------------+-----------+---------+ ``` ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -208,6 +208,15 @@ func (h *Handler) AuthCheck(c *gin.Context) {
|
||||
successNoData(c, "Admin is authorized")
|
||||
}
|
||||
|
||||
// ListTasks handle list tasks
|
||||
func (h *Handler) ListTasks(c *gin.Context) {
|
||||
tasks, err := h.service.ListTasks()
|
||||
if err != nil {
|
||||
errorResponse(c, err.Error(), 500)
|
||||
}
|
||||
success(c, tasks, "Get all tasks")
|
||||
}
|
||||
|
||||
// ListUsers handle list users
|
||||
func (h *Handler) ListUsers(c *gin.Context) {
|
||||
users, err := h.service.ListUsers()
|
||||
|
||||
Reference in New Issue
Block a user