diff --git a/apps/web/messages/en.json b/apps/web/messages/en.json index 814c11f17..b28d6f29a 100644 --- a/apps/web/messages/en.json +++ b/apps/web/messages/en.json @@ -69,7 +69,8 @@ "classicAICenter": "Classic AI Center", "governance": "AI Governance", "awooop": "AwoooP", - "iwooos": "IwoooS" + "iwooos": "IwoooS", + "iwooosSecurityCompliance": "IwoooS 安全合規" }, "locale": { "switch": "Switch Language", diff --git a/apps/web/messages/zh-TW.json b/apps/web/messages/zh-TW.json index 124f7dc54..7b32c2c68 100644 --- a/apps/web/messages/zh-TW.json +++ b/apps/web/messages/zh-TW.json @@ -69,7 +69,8 @@ "classicAICenter": "經典 AI 中心", "governance": "AI 治理", "awooop": "AwoooP", - "iwooos": "IwoooS" + "iwooos": "IwoooS", + "iwooosSecurityCompliance": "IwoooS 安全合規" }, "locale": { "switch": "切換語系", diff --git a/apps/web/src/components/layout/sidebar.tsx b/apps/web/src/components/layout/sidebar.tsx index 4af026774..d31ea0a42 100644 --- a/apps/web/src/components/layout/sidebar.tsx +++ b/apps/web/src/components/layout/sidebar.tsx @@ -54,6 +54,7 @@ type NavItemConfig = { href: string labelKey: string Icon: typeof LayoutDashboard + aliases?: string[] badge?: boolean // 是否顯示動態徽章 } @@ -71,7 +72,7 @@ type NavSection = { // 可觀測性 /observability → 整合: 監控 + APM + 錯誤 + 應用 + 服務 (5 Tab) [暫指 /monitoring] // 自動化 /automation → 整合: 自動修復 + 神經指揮 + Drift (3 Tab) [暫指 /auto-repair] // 營運 /operations → 整合: 部署 + 工單 + 成本 + 行動日誌 + 計費 (5 Tab) [暫指 /deployments] -// 安全合規 /security-compliance → 整合: 安全 + 合規 (2 Tab) [暫指 /security] +// IwoooS 安全合規 /iwooos → 整合: IwoooS + 安全合規;/security-compliance 保留相容高亮 // 知識 /knowledge → 知識庫 [暫指 /knowledge-base] // ============================================================ @@ -84,8 +85,7 @@ const NAV_SECTIONS: NavSection[] = [ { id: 'observability', href: '/observability', labelKey: 'observability', Icon: Monitor }, { id: 'automation', href: '/automation', labelKey: 'automation', Icon: Wrench }, { id: 'operations', href: '/operations', labelKey: 'operations', Icon: Package }, - { id: 'security-compliance', href: '/security-compliance', labelKey: 'securityCompliance',Icon: Shield }, - { id: 'iwooos', href: '/iwooos', labelKey: 'iwooos', Icon: Radar }, + { id: 'iwooos-security', href: '/iwooos', labelKey: 'iwooosSecurityCompliance', Icon: Radar, aliases: ['/security-compliance'] }, { id: 'knowledge', href: '/knowledge', labelKey: 'knowledge', Icon: BookOpen }, { id: 'governance', href: '/governance', labelKey: 'governance', Icon: ShieldCheck }, { id: 'awooop', href: '/awooop/work-items', labelKey: 'awooop', Icon: BrainCircuit }, @@ -132,7 +132,7 @@ export function Sidebar({ setMounted(true) }, []) - const isActive = (href: string) => { + const isRouteActive = (href: string) => { const fullHref = `/${locale}${href === '/' ? '' : href}` if (href === '/') { return pathname === `/${locale}` || pathname === `/${locale}/` @@ -140,6 +140,10 @@ export function Sidebar({ return pathname === fullHref || pathname.startsWith(fullHref + '/') } + const isActive = (item: NavItemConfig) => ( + isRouteActive(item.href) || item.aliases?.some(alias => isRouteActive(alias)) === true + ) + return (