From 07aa50e8ffb434c4dfb341dbbbbb1488201c0cee Mon Sep 17 00:00:00 2001 From: chiyi Date: Sun, 5 Jul 2026 19:52:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/service/admin_read.go | 10 +++++++++- frontend/src/layouts/PublicLayout.vue | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/internal/service/admin_read.go b/backend/internal/service/admin_read.go index d49829d..164b7b4 100644 --- a/backend/internal/service/admin_read.go +++ b/backend/internal/service/admin_read.go @@ -429,7 +429,7 @@ func (s *AdminReadService) Images(ctx context.Context, limit, offset int, kind s if offset < 0 { offset = 0 } - allFiles, stats, err := s.scanGeneratedFiles(ctx) + allFiles, _, err := s.scanGeneratedFiles(ctx) if err != nil { return nil, 0, nil, err } @@ -441,11 +441,19 @@ func (s *AdminReadService) Images(ctx context.Context, limit, offset int, kind s pinned = set } } + // KPI stats must reflect what the manager actually shows, so recompute them + // after dropping showcase files (independent of the kind tab filter). + stats := map[string]any{"total": 0, "image": 0, "video": 0, "size_bytes": int64(0)} filtered := make([]generatedFile, 0, len(allFiles)) for _, item := range allFiles { if _, ok := pinned[strings.TrimLeft(item.Name, "/")]; ok { continue } + if _, ok := stats[item.Kind]; ok { + stats[item.Kind] = stats[item.Kind].(int) + 1 + } + stats["total"] = stats["total"].(int) + 1 + stats["size_bytes"] = stats["size_bytes"].(int64) + item.Size if kind == "" || item.Kind == kind { filtered = append(filtered, item) } diff --git a/frontend/src/layouts/PublicLayout.vue b/frontend/src/layouts/PublicLayout.vue index 4186b6d..9205168 100644 --- a/frontend/src/layouts/PublicLayout.vue +++ b/frontend/src/layouts/PublicLayout.vue @@ -88,7 +88,7 @@ const currentLabel = computed(() => { - +