From 5cd7ea4a391b7b7e378a9fd2443d0e8b10cbb32c Mon Sep 17 00:00:00 2001 From: "Logan.Li" Date: Mon, 14 Sep 2026 15:27:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E4=BE=A7=E8=BE=B9=E6=A0=8F?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E5=A4=B1=E6=95=88=E4=B8=8E=20Jenkins=20?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E6=9C=AC=E5=9C=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ScrollArea 增加 min-h-0,修复 flex 子项不收缩导致导航超屏无法滚动 - Jenkins 品牌图标替换 simple-icons 单色红为仓库本地官方多色 SVG --- frontend/public/icons/jenkins.svg | 1 + .../components/icons/TechnologyBrandIcon.tsx | 25 ++++++++++++++++--- frontend/src/components/layout/Sidebar.tsx | 3 ++- 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 frontend/public/icons/jenkins.svg diff --git a/frontend/public/icons/jenkins.svg b/frontend/public/icons/jenkins.svg new file mode 100644 index 0000000..2ccb4f3 --- /dev/null +++ b/frontend/public/icons/jenkins.svg @@ -0,0 +1 @@ + diff --git a/frontend/src/components/icons/TechnologyBrandIcon.tsx b/frontend/src/components/icons/TechnologyBrandIcon.tsx index 2dccac5..3063f9c 100644 --- a/frontend/src/components/icons/TechnologyBrandIcon.tsx +++ b/frontend/src/components/icons/TechnologyBrandIcon.tsx @@ -4,7 +4,6 @@ import { siDocker, siElasticsearch, siGrafana, - siJenkins, siKubernetes, siPrometheus, } from 'simple-icons'; @@ -13,12 +12,17 @@ const ICONS = { docker: siDocker, elasticsearch: siElasticsearch, grafana: siGrafana, - jenkins: siJenkins, kubernetes: siKubernetes, prometheus: siPrometheus, } satisfies Record; -export type TechnologyBrand = keyof typeof ICONS; +// Jenkins 使用仓库本地官方多色 SVG(public/icons/jenkins.svg), +// 替换 simple-icons 的单色红色版本。 // Logan.Li +const LOCAL_SVG: Partial> = { + jenkins: '/icons/jenkins.svg', +}; + +export type TechnologyBrand = keyof typeof ICONS | 'jenkins'; interface TechnologyBrandIconProps { brand: TechnologyBrand; @@ -31,7 +35,20 @@ export function TechnologyBrandIcon({ className = 'h-5 w-5', title, }: TechnologyBrandIconProps) { - const icon = ICONS[brand]; + const localSrc = LOCAL_SVG[brand]; + if (localSrc) { + return ( + {title + ); + } + + const icon: SimpleIcon = ICONS[brand as keyof typeof ICONS]; const label = title || icon.title; return ( diff --git a/frontend/src/components/layout/Sidebar.tsx b/frontend/src/components/layout/Sidebar.tsx index f4df023..bf7b7f5 100644 --- a/frontend/src/components/layout/Sidebar.tsx +++ b/frontend/src/components/layout/Sidebar.tsx @@ -415,7 +415,8 @@ export function Sidebar({ mobileOpen, onMobileClose }: SidebarProps) { {/* Menu Items */} - + {/* min-h-0 允许 flex 子项收缩,否则导航超出高度时 ScrollArea 不会出现滚动 // Logan.Li */} +