mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-09-24 02:10:55 +02:00
Add files via upload
This commit is contained in:
+11
-5
@@ -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,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user