feat: admin端UI

This commit is contained in:
Blizzard
2026-06-27 12:06:29 +08:00
parent d2662a1f37
commit 2d9695e940
9 changed files with 2117 additions and 85 deletions
+29 -7
View File
@@ -3,10 +3,16 @@ import { Soon } from "./components/Soon";
// 路由注册表 —— 控制台的单一事实源:导航 + 内容都从这里派生。
// 新增页面 = 在此加一条;real 页面用 lazy 懒加载(代码分割)。
const DashboardPage = lazy(() => import("./pages/DashboardPage").then((m) => ({ default: m.DashboardPage })));
const ModelsPage = lazy(() => import("./pages/ModelsPage").then((m) => ({ default: m.ModelsPage })));
const DatasourcesPage = lazy(() => import("./pages/DatasourcesPage").then((m) => ({ default: m.DatasourcesPage })));
const PricingPage = lazy(() => import("./pages/PricingPage").then((m) => ({ default: m.PricingPage })));
const StatusPage = lazy(() => import("./pages/StatusPage").then((m) => ({ default: m.StatusPage })));
const EvalsPage = lazy(() => import("./pages/EvalsPage").then((m) => ({ default: m.EvalsPage })));
const TenantsPage = lazy(() => import("./pages/TenantsPage").then((m) => ({ default: m.TenantsPage })));
const GuardrailsPage = lazy(() => import("./pages/GuardrailsPage").then((m) => ({ default: m.GuardrailsPage })));
export interface RouteDef {
path: string;
@@ -17,6 +23,13 @@ export interface RouteDef {
}
export const routes: RouteDef[] = [
{
path: "/dashboard",
label: "概览",
group: "分析",
ready: true,
element: <DashboardPage />,
},
{
path: "/models",
label: "模型",
@@ -26,14 +39,14 @@ export const routes: RouteDef[] = [
},
{
path: "/datasources",
label: "数据源",
label: "数据源 & RAG",
group: "配置",
ready: true,
element: <DatasourcesPage />,
},
{
path: "/pricing",
label: "计价",
label: "计价 & 预算",
group: "配置",
ready: true,
element: <PricingPage />,
@@ -45,21 +58,30 @@ export const routes: RouteDef[] = [
ready: true,
element: <StatusPage />,
},
{
path: "/evals",
label: "自动评测",
group: "运维",
ready: true,
element: <EvalsPage />,
},
{
path: "/tenants",
label: "租户",
label: "租户 & 用户",
group: "平台",
element: <Soon title="租户 / 工作区" desc="多租户隔离、配额、用户与计费。垂直行业平台级复制的基座。" />,
ready: true,
element: <TenantsPage />,
},
{
path: "/guardrails",
label: "护栏",
label: "安全护栏",
group: "平台",
element: <Soon title="护栏" desc="输入/输出 Guardrail 规则(脱敏 / 免责 / 强制引用)。受监管垂直必备。" />,
ready: true,
element: <GuardrailsPage />,
},
];
export const defaultPath = "/models";
export const defaultPath = "/dashboard";
// 派生分组导航(保持注册顺序)。
export function navGroups(): Array<{ group: string; items: RouteDef[] }> {