feat(admin): 仪表盘次级概览卡接真数据(A5) — 8卡聚合,存储卡诚实占位
- Dashboard.tsx 去掉占位块 → OverviewSection; 新增 admin/modules/dashboard/(MiniMetric/useDashboardExtras/overviewMetrics/OverviewSection) - 8卡用现有 lib/api 导出: LLM组/RAG文档/自动化/已装插件(含toolCount)/用户/网关请求/LLM调用+子代理/存储(缺只读端点→诚实占位) - 端点报错→值'—'+徽标'端点报错'+hint后端原文(不崩不伪造) - 仅碰 Dashboard.tsx+dashboard/*, 未动 api.ts/types.ts(避免并发冲突) - 前端 npm run build 绿(156 modules)
This commit is contained in:
1 parent
f28995c1e5
commit
ca2faa0f95
5 files changed
+343
-23
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { Surface } from "../../../components/primitives";
|
||||
import { MiniMetric } from "./MiniMetric";
|
||||
import { buildOverviewMetrics } from "./overviewMetrics";
|
||||
import { useDashboardExtras } from "./useDashboardExtras";
|
||||
|
||||
/** The secondary dashboard block: 资源 / LLM / 业务 aggregates pulled from the
|
||||
* real admin endpoints (design/10 §3 #1, §4). Each card drills down; the most
|
||||
* detailed view always lives on its own module page. */
|
||||
export function OverviewSection(): ReactNode {
|
||||
const extras = useDashboardExtras();
|
||||
const metrics = buildOverviewMetrics(extras);
|
||||
return (
|
||||
<Surface className="space-y-3">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<h3 className="text-sm font-semibold">资源 / LLM / 业务概览</h3>
|
||||
<span className="text-xs text-[var(--mu-text-lo)]">真实聚合 · 每卡可下钻</span>
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
|
||||
{metrics.map((m) => (
|
||||
<MiniMetric key={m.label} {...m} />
|
||||
))}
|
||||
</div>
|
||||
<div className="pt-1 text-xs text-[var(--mu-text-lo)]">
|
||||
卡片即入口,点击下钻到对应模块;缺端点的卡片只标注缺口,不伪造数值。
|
||||
</div>
|
||||
</Surface>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user