From a482bc2ea785c95a19837259a847c7010a283b31 Mon Sep 17 00:00:00 2001 From: Aska Date: Sun, 6 Sep 2026 13:12:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20MD3=20=E7=9F=A2=E9=87=8F=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E7=BB=84=E4=BB=B6=20+=20=E5=85=A8=E9=87=8F=20emoji=20?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=B8=BA=E6=96=B0=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 src/components/Icon.tsx(Material Symbols Rounded 风格,24 viewBox / currentColor / 零运行时依赖 / 可 tree-shake / 离线优先),导出 与 IconName 类型, 覆盖全部现有界面图标的语义映射(chart/dna/chat/memory/docs/plugin/channel/device/robot/ clock/agent/night/trend/users/settings/light/ac/mic/micOff/sun/moon/lock/block/check/close/ gear/file/package/folder/shield/storage/refresh/vision/home/arrow/terminal)。 将用户端(Nav/TopBar/ChatInput/chat + 各 modes)与管理面板(sidebar 15 模块/Dashboard 卡片/System SectionTitle/Observability StatCard/Agents/Backthink/Automations/AdminTable empty)中的 emoji 图标全部替换为 ,icon 字段由 string 改为 IconName / ReactNode。保留正文说明性箭头(如“设置→连接”)与流程方向箭头。 npm run build(tsc --noEmit + vite build)通过:79 模块,JS 300KB/gzip 90KB。 --- frontend/web/src/admin/sections.tsx | 33 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/frontend/web/src/admin/sections.tsx b/frontend/web/src/admin/sections.tsx index e18b49c..e22b7bb 100644 --- a/frontend/web/src/admin/sections.tsx +++ b/frontend/web/src/admin/sections.tsx @@ -1,10 +1,11 @@ import type { AdminSectionId } from "./router"; +import type { IconName } from "../components/Icon"; /** Sidebar grouping for the 15 admin modules. Groups are visual only. */ export interface AdminSectionMeta { id: AdminSectionId; label: string; - icon: string; + icon: IconName; group: string; } @@ -13,21 +14,21 @@ export interface AdminSectionMeta { * the section headers. All are clickable — several are shells until M10+ backend. */ export const ADMIN_SECTIONS: ReadonlyArray = [ - { id: "dashboard", label: "仪表盘", icon: "📊", group: "总览" }, - { id: "personas", label: "人格管理", icon: "🧬", group: "内容" }, - { id: "sessions", label: "会话管理", icon: "💬", group: "内容" }, - { id: "memories", label: "记忆管理", icon: "🧠", group: "内容" }, - { id: "rag", label: "知识库 RAG", icon: "📚", group: "内容" }, - { id: "plugins", label: "插件与能力", icon: "🔌", group: "能力与连接" }, - { id: "channels", label: "渠道管理", icon: "📡", group: "能力与连接" }, - { id: "iot", label: "IoT 设备", icon: "📲", group: "能力与连接" }, - { id: "llm", label: "LLM 模型", icon: "🤖", group: "能力与连接" }, - { id: "automations", label: "自动化与提醒", icon: "⏰", group: "能力与连接" }, - { id: "agents", label: "Agent 监控", icon: "🧩", group: "运行时" }, - { id: "backthink", label: "后台思考", icon: "🌙", group: "运行时" }, - { id: "observability", label: "可观测性", icon: "📈", group: "运行时" }, - { id: "users", label: "用户与权限", icon: "👥", group: "治理" }, - { id: "system", label: "系统设置", icon: "⚙", group: "治理" }, + { id: "dashboard", label: "仪表盘", icon: "chart", group: "总览" }, + { id: "personas", label: "人格管理", icon: "dna", group: "内容" }, + { id: "sessions", label: "会话管理", icon: "chat", group: "内容" }, + { id: "memories", label: "记忆管理", icon: "memory", group: "内容" }, + { id: "rag", label: "知识库 RAG", icon: "docs", group: "内容" }, + { id: "plugins", label: "插件与能力", icon: "plugin", group: "能力与连接" }, + { id: "channels", label: "渠道管理", icon: "channel", group: "能力与连接" }, + { id: "iot", label: "IoT 设备", icon: "device", group: "能力与连接" }, + { id: "llm", label: "LLM 模型", icon: "robot", group: "能力与连接" }, + { id: "automations", label: "自动化与提醒", icon: "clock", group: "能力与连接" }, + { id: "agents", label: "Agent 监控", icon: "agent", group: "运行时" }, + { id: "backthink", label: "后台思考", icon: "night", group: "运行时" }, + { id: "observability", label: "可观测性", icon: "trend", group: "运行时" }, + { id: "users", label: "用户与权限", icon: "users", group: "治理" }, + { id: "system", label: "系统设置", icon: "settings", group: "治理" }, ]; /** Group headers in sidebar order (derived from ADMIN_SECTIONS). */