Add files via upload

This commit is contained in:
公明
2026-07-21 16:38:37 +08:00
committed by GitHub
parent cea8d4bcc0
commit 78c572927b
+11 -5
View File
@@ -788,7 +788,7 @@ func (h *C2Handler) ListEvents(c *gin.Context) {
TaskID: c.Query("task_id"), TaskID: c.Query("task_id"),
} }
if since := c.Query("since"); since != "" { if since := c.Query("since"); since != "" {
if t, err := time.Parse(time.RFC3339, since); err == nil { if t, err := database.ParseRFC3339Time(since); err == nil {
filter.Since = &t filter.Since = &t
} }
} }
@@ -832,11 +832,17 @@ func (h *C2Handler) ListEvents(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return return
} }
levelCounts, err := h.mgr().DB().CountC2EventsByLevelForAccess(filter, access)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"events": events, "events": events,
"total": total, "total": total,
"page": page, "level_counts": levelCounts,
"page_size": pageSize, "page": page,
"page_size": pageSize,
}) })
} }