增加违禁词管理 增加多选操作

This commit is contained in:
2026-07-05 03:00:49 +08:00
parent 4d5b49c2a9
commit 10d0732f8c
24 changed files with 836 additions and 35 deletions
+12 -1
View File
@@ -29,6 +29,7 @@ func (h *AdminReadHandler) Users(c *gin.Context) {
for _, user := range users {
row := userPublic(user)
row["generation_count"] = user.GenerationCount
row["banned_word_hits"] = user.BannedWordHits
out = append(out, row)
}
c.JSON(http.StatusOK, gin.H{"data": out, "stats": stats})
@@ -56,7 +57,7 @@ func (h *AdminReadHandler) Logs(c *gin.Context) {
}
}
items, total, stats, err := h.admin.Logs(c.Request.Context(), limit, offset, kind, status, nil, since, "", "", c.Query("source"), false)
items, total, stats, err := h.admin.Logs(c.Request.Context(), limit, offset, kind, status, nil, since, "", "", c.Query("source"), false, false, false)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"detail": "failed to load logs"})
return
@@ -158,6 +159,16 @@ func (h *AdminReadHandler) Invites(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"data": items, "stats": stats})
}
// DeleteImage removes one generated file (plus derived stills) and blanks the
// log rows referencing it. Admin 图片管理 delete; ?name= is the storage key.
func (h *AdminReadHandler) DeleteImage(c *gin.Context) {
if err := h.admin.DeleteFile(c.Request.Context(), c.Query("name")); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"detail": err.Error()})
return
}
c.JSON(http.StatusOK, gin.H{"ok": true})
}
func (h *AdminReadHandler) Providers(c *gin.Context) {
items, err := h.admin.Providers(c.Request.Context())
if err != nil {