2291f60380
桌面端从扁平 dev 工具风改为深色高端 AI 控制台:分层表面 + 紫青强调 + 微光 + 首页仪表盘,提升第一印象与吸引力。 - 设计 tokens: tailwind ink 分层调色板 + glow/card 阴影; index.css 深色基底 + 品牌渐变 + 深色滚动条 - shell: TopBar(品牌渐变+毛玻璃+发光健康灯) / LeftNav(激活态紫色高亮+左光条) / BottomDrawer(深色+状态色) - 新 views/Home 工作台仪表盘: 渐变 hero + 4 状态卡 + 3 能力卡 + 快速开始(默认首页) - 画布: TypedNode 深色节点卡; StudioView ReactFlow colorMode=dark + 深色工具栏/面板/ MiniMap; Inspector 深色表单 - KbView/MemoryView/MemoryPanel/Placeholder 全深色化; 进度条改紫青渐变 - 纯前端改造, npm build✓; 浏览器验证: 仪表盘 + 编排画布深色呈现 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
76 lines
3.9 KiB
TypeScript
76 lines
3.9 KiB
TypeScript
import { useHealth } from "../lib/health";
|
||
import type { ViewKey } from "../shell/LeftNav";
|
||
|
||
function Stat({ label, value, sub, accent }: { label: string; value: string; sub: string; accent: string }) {
|
||
return (
|
||
<div className="rounded-xl border border-line bg-ink-850 p-4">
|
||
<div className="text-xs text-slate-500">{label}</div>
|
||
<div className={`mt-1 text-2xl font-semibold ${accent}`}>{value}</div>
|
||
<div className="mt-0.5 text-[11px] text-slate-500">{sub}</div>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
const CAPS = [
|
||
{ icon: "◆", title: "Agent 编排", desc: "React Flow 画布 → Eino 动态图 → 流式执行", to: "studio" as ViewKey, color: "text-violet-400" },
|
||
{ icon: "▣", title: "RAG 知识库", desc: "多文件入库 + 向量/全文/图谱 三路混合检索", to: "kb" as ViewKey, color: "text-cyan-400" },
|
||
{ icon: "◇", title: "偏好记忆", desc: "画像 + 多轮历史,让模型“知道是你”", to: "memory" as ViewKey, color: "text-emerald-400" },
|
||
];
|
||
|
||
// 工作台:平台概览 + 快捷入口(深色 AI 控制台首页)。
|
||
export function Home({ onSelect }: { onSelect: (v: ViewKey) => void }) {
|
||
const h = useHealth();
|
||
return (
|
||
<div className="h-full overflow-auto p-8">
|
||
<div className="mx-auto max-w-5xl">
|
||
<div className="flex items-center gap-3">
|
||
<div className="flex h-11 w-11 items-center justify-center rounded-xl bg-gradient-to-br from-violet-500 to-cyan-500 text-lg font-bold text-white shadow-glow">
|
||
S
|
||
</div>
|
||
<div>
|
||
<h1 className="brand-gradient text-2xl font-bold leading-tight">sundynix-agentix</h1>
|
||
<p className="text-sm text-slate-500">分层式 AI Agent 平台 · 编排 / 知识库 / 记忆</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div className="mt-6 grid grid-cols-2 gap-3 md:grid-cols-4">
|
||
<Stat label="对话模型" value="DeepSeek" sub="chat · 控制面" accent="text-violet-300" />
|
||
<Stat label="向量模型" value="百炼 v3" sub="embedding · 1024维" accent="text-cyan-300" />
|
||
<Stat label="混合检索" value="3 路" sub="向量+全文+图谱" accent="text-emerald-300" />
|
||
<Stat label="网关" value={h.gateway ? "在线" : "离线"} sub={h.persisted ? "持久化就绪" : "降级"} accent={h.gateway ? "text-emerald-300" : "text-rose-300"} />
|
||
</div>
|
||
|
||
<div className="mt-8 grid grid-cols-1 gap-4 md:grid-cols-3">
|
||
{CAPS.map((c) => (
|
||
<button
|
||
key={c.to}
|
||
onClick={() => onSelect(c.to)}
|
||
className="group rounded-xl border border-line bg-ink-850 p-5 text-left transition hover:border-violet-500/50 hover:bg-ink-800"
|
||
>
|
||
<div className={`text-2xl ${c.color}`}>{c.icon}</div>
|
||
<div className="mt-3 font-medium text-slate-100">{c.title}</div>
|
||
<div className="mt-1 text-xs leading-relaxed text-slate-500">{c.desc}</div>
|
||
<div className="mt-3 text-xs text-violet-400 opacity-0 transition group-hover:opacity-100">进入 →</div>
|
||
</button>
|
||
))}
|
||
</div>
|
||
|
||
<div className="mt-8 rounded-xl border border-line bg-ink-900 p-5">
|
||
<div className="mb-3 text-sm font-medium text-slate-300">快速开始</div>
|
||
<div className="flex flex-wrap gap-2">
|
||
<button onClick={() => onSelect("studio")} className="rounded-lg bg-violet-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-violet-500">
|
||
+ 新建 Agent 编排
|
||
</button>
|
||
<button onClick={() => onSelect("kb")} className="rounded-lg border border-line px-3 py-1.5 text-sm text-slate-300 hover:bg-ink-800">
|
||
⬆ 入库知识
|
||
</button>
|
||
<button onClick={() => onSelect("memory")} className="rounded-lg border border-line px-3 py-1.5 text-sm text-slate-300 hover:bg-ink-800">
|
||
◇ 管理记忆
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|