diff --git a/frontend/app/components/common/BrandMark.tsx b/frontend/app/components/common/BrandMark.tsx new file mode 100644 index 0000000..07e3e88 --- /dev/null +++ b/frontend/app/components/common/BrandMark.tsx @@ -0,0 +1,24 @@ +/** Product logo mark used in the sidebar header. */ +export function BrandMark({ size = 31 }: { size?: number }) { + return ( + + + + + + ); +} diff --git a/frontend/app/components/common/Icon.tsx b/frontend/app/components/common/Icon.tsx deleted file mode 100644 index 6e4a11d..0000000 --- a/frontend/app/components/common/Icon.tsx +++ /dev/null @@ -1,208 +0,0 @@ -type IconName = - | "brand" - | "home" - | "script" - | "schedule" - | "experiment" - | "database" - | "settings" - | "chevron" - | "search" - | "plus" - | "upload" - | "folder" - | "notebook" - | "python" - | "refresh" - | "close" - | "check" - | "info" - | "lock" - | "unlock" - | "workspace" - | "menu" - | "external" - | "release" - | "play" - | "grip-vertical"; - -type IconProps = { - name: IconName; - size?: number; - strokeWidth?: number; -}; - -export default function Icon({ - name, - size = 18, - strokeWidth = 1.8, -}: IconProps) { - const common = { - width: size, - height: size, - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-hidden": true, - }; - - if (name === "brand") { - return ( - - - - - - ); - } - - const paths: Record, React.ReactNode> = { - home: ( - <> - - - - ), - script: ( - <> - - - - ), - schedule: ( - <> - - - - ), - experiment: ( - <> - - - - ), - database: ( - <> - - - - - ), - settings: ( - <> - - - - ), - chevron: , - search: ( - <> - - - - ), - plus: , - upload: ( - <> - - - - ), - folder: ( - - ), - notebook: ( - <> - - - - ), - python: ( - <> - - - - - - ), - refresh: ( - <> - - - - ), - close: , - check: , - info: ( - <> - - - - ), - lock: ( - <> - - - - ), - unlock: ( - <> - - - - ), - workspace: ( - <> - - - - ), - menu: ( - <> - - - ), - external: ( - <> - - - - ), - release: ( - <> - - - - ), - play: , - "grip-vertical": ( - <> - - - - - - - - ), - }; - - return ( - - {paths[name]} - - ); -} diff --git a/frontend/app/components/common/Topbar.tsx b/frontend/app/components/common/Topbar.tsx index 2baf978..2c536c8 100644 --- a/frontend/app/components/common/Topbar.tsx +++ b/frontend/app/components/common/Topbar.tsx @@ -1,4 +1,4 @@ -import Icon from "./Icon"; +import { ChevronRight, LayoutGrid } from "lucide-react"; import type { AuthUser, AuthWorkspace } from "../../context/AuthContext"; type TopbarProps = { @@ -38,7 +38,7 @@ export function Topbar({ className="grid h-[31px] w-[31px] rotate-180 cursor-pointer place-items-center rounded-[7px] border border-transparent bg-white text-[#7b8999] hover:border-[#b9c9da] hover:bg-[#f7faff]" type="button" > - +
@@ -67,7 +67,7 @@ export function Topbar({ onClick={() => onSetWorkspaceMenuOpen(!workspaceMenuOpen)} > - + 当前 Workspace @@ -75,7 +75,7 @@ export function Topbar({ {currentWorkspace.workspace_name} - + {workspaceMenuOpen && (
@@ -96,7 +96,7 @@ export function Topbar({ onSetWorkspaceMenuOpen(false); }} > - + {workspace.workspace_name} diff --git a/frontend/app/features/admin/DashboardPage.tsx b/frontend/app/features/admin/DashboardPage.tsx index 7ef7afe..45286a5 100644 --- a/frontend/app/features/admin/DashboardPage.tsx +++ b/frontend/app/features/admin/DashboardPage.tsx @@ -1,4 +1,11 @@ -import Icon from "../../components/common/Icon"; +import { + Calendar, + Check, + FileText, + LayoutGrid, + Settings, + type LucideIcon, +} from "lucide-react"; import { useAuth, usePermission } from "../../context/AuthContext"; const TREND_VALUES = [38, 55, 44, 73, 61, 86, 78] as const; @@ -50,22 +57,24 @@ export function DashboardPage({
- {[ - { icon: "script" as const, value: scriptCount, label: "工作副本" }, - { icon: "workspace" as const, value: 2, label: "Workspace" }, - { icon: "settings" as const, value: 4, label: "平台用户" }, - { - icon: "check" as const, - value: online ? "正常" : "检查中", - label: "平台状态", - }, - ].map((item) => ( + {( + [ + { Icon: FileText, value: scriptCount, label: "工作副本" }, + { Icon: LayoutGrid, value: 2, label: "Workspace" }, + { Icon: Settings, value: 4, label: "平台用户" }, + { + Icon: Check, + value: online ? "正常" : "检查中", + label: "平台状态", + }, + ] as Array<{ Icon: LucideIcon; value: number | string; label: string }> + ).map((item) => (
- + {item.value} @@ -81,7 +90,7 @@ export function DashboardPage({ className="flex cursor-pointer items-center gap-2 rounded-[7px] border border-[#d8e4ef] bg-white px-[18px] py-[13px] text-[#346587]" onClick={() => onNavigate("scripts")} > - + 构建脚本 {hasSystemView && ( @@ -98,7 +107,7 @@ export function DashboardPage({ className="flex cursor-pointer items-center gap-2 rounded-[7px] border border-[#d8e4ef] bg-white px-[18px] py-[13px] text-[#346587]" onClick={() => onNavigate("system")} > - + 系统管理 )} @@ -226,7 +235,7 @@ export function DashboardPage({ > - + {row[0]} diff --git a/frontend/app/features/admin/ProjectMembersDrawer.tsx b/frontend/app/features/admin/ProjectMembersDrawer.tsx index 7441acb..285e5c9 100644 --- a/frontend/app/features/admin/ProjectMembersDrawer.tsx +++ b/frontend/app/features/admin/ProjectMembersDrawer.tsx @@ -1,5 +1,5 @@ import { type Workspace, type WorkspaceMember } from "../../services/api"; -import Icon from "../../components/common/Icon"; +import { Plus, X } from "lucide-react"; export function ProjectMembersDrawer({ open, @@ -60,7 +60,7 @@ export function ProjectMembersDrawer({

{selectedProject.workspace_name}

@@ -80,7 +80,7 @@ export function ProjectMembersDrawer({ onClick={() => onAddMembers()} style={{ fontSize: 13, padding: "6px 12px" }} > - 添加成员 + 添加成员 diff --git a/frontend/app/features/platform/CreateFolderModal.tsx b/frontend/app/features/platform/CreateFolderModal.tsx index 8cd21aa..3335f34 100644 --- a/frontend/app/features/platform/CreateFolderModal.tsx +++ b/frontend/app/features/platform/CreateFolderModal.tsx @@ -1,5 +1,5 @@ import { type FormEvent } from "react"; -import Icon from "../../components/common/Icon"; +import { Folder } from "lucide-react"; import { AppFormDialog, dialogPrimaryButtonClass, @@ -43,7 +43,7 @@ export function CreateFolderModal({ >
- + 创建到:{parentPath || "个人根目录"}