diff --git a/2_frontend/src/features/admin/pages/AdminStatsPage.test.tsx b/2_frontend/src/features/admin/pages/AdminStatsPage.test.tsx index 6bbde95..cb49380 100644 --- a/2_frontend/src/features/admin/pages/AdminStatsPage.test.tsx +++ b/2_frontend/src/features/admin/pages/AdminStatsPage.test.tsx @@ -91,7 +91,6 @@ describe("AdminStatsPage", () => { asUser("ADMIN") mount() expect(await screen.findByText("1,500")).toBeTruthy() // 총 토큰 - expect(screen.getByText("$0.1234")).toBeTruthy() expect(screen.getByText("2.5s")).toBeTruthy() expect(screen.getByText("김개발")).toBeTruthy() expect(client.apiGet).toHaveBeenCalledTimes(1) diff --git a/2_frontend/src/features/admin/pages/AdminStatsPage.tsx b/2_frontend/src/features/admin/pages/AdminStatsPage.tsx index b0f1d76..a7ef0cf 100644 --- a/2_frontend/src/features/admin/pages/AdminStatsPage.tsx +++ b/2_frontend/src/features/admin/pages/AdminStatsPage.tsx @@ -9,7 +9,6 @@ import { ApiError } from "@/lib/api/errors" import { useAdminStats } from "../api/admin.api" const fmtInt = (n: number) => n.toLocaleString("ko-KR") -const fmtUsd = (n: number) => `$${n.toFixed(n < 1 ? 4 : 2)}` const fmtSec = (ms: number | null) => (ms === null ? "–" : `${(ms / 1000).toFixed(1)}s`) const isoDay = (d: Date) => d.toISOString().slice(0, 10) @@ -20,7 +19,8 @@ const PRESETS: { label: string; days: number }[] = [ { label: "90일", days: 90 }, ] -/** 관리자 대시보드 — 총 토큰·비용·응답시간 + 사용자별·일별. 서버는 ChatMessage 집계만(새로 모으는 것 없음). */ +/** 관리자 대시보드 — 총 토큰·응답시간 + 사용자별·일별. 서버는 ChatMessage 집계만(새로 모으는 것 없음). + * 비용은 안 보여줌 — 사내 LLM(FabriX) 은 단가가 없어 OpenCode 가 0 으로 줌. 단가 정해지면 그때 카드 추가. */ export default function AdminStatsPage() { const navigate = useNavigate() const isAdmin = useAuthStore((s) => s.user?.role === "ADMIN") @@ -86,7 +86,7 @@ export default function AdminStatsPage() { {t && ( <> {/* 요약 카드 4개 */} -
+
-
@@ -115,7 +114,7 @@ export default function AdminStatsPage() { {data.byDay.map((d) => (
@@ -133,14 +132,13 @@ export default function AdminStatsPage() { 요청 세션 토큰 - 비용 평균 응답 {data.byUser.length === 0 && ( - + 기간 내 사용자 없음 @@ -154,7 +152,6 @@ export default function AdminStatsPage() { {fmtInt(u.requests)} {fmtInt(u.sessions)} {fmtInt(u.totalTokens)} - {fmtUsd(u.costUsd)} {fmtSec(u.avgElapsedMs)} ))}