feat: add connections page, rename dashboard page to overview

This commit is contained in:
2026-08-23 20:01:41 +08:00
parent ba65c43183
commit e3f575096b
11 changed files with 1416 additions and 34 deletions
+8 -6
View File
@@ -24,13 +24,14 @@ import {
} from '@/components/ui/sidebar'
import { Badge } from '@/components/ui/badge'
export type NavTab = 'dashboard' | 'links' | 'routes' | 'topology' | 'interfaces' | 'settings'
export type NavTab = 'overview' | 'connections' | 'routes' | 'topology' | 'interfaces' | 'settings'
interface AppSidebarProps {
currentTab: NavTab
onSelectTab: (tab: NavTab) => void
onlineDevices?: number
linksCount?: number
establishedLinksCount?: number
isConnected?: boolean
}
@@ -39,20 +40,21 @@ export function AppSidebar({
onSelectTab,
onlineDevices = 0,
linksCount = 0,
establishedLinksCount = 0,
isConnected = false,
}: AppSidebarProps) {
const navItems = [
{
id: 'dashboard' as NavTab,
title: '仪表盘总览',
id: 'overview' as NavTab,
title: '总览',
icon: LayoutDashboard,
badge: isConnected ? 'Live' : undefined,
},
{
id: 'links' as NavTab,
title: '线路与链路',
id: 'connections' as NavTab,
title: '连接',
icon: Network,
badge: linksCount > 0 ? `${linksCount}` : undefined,
badge: linksCount > 0 ? `${establishedLinksCount}/${linksCount}` : undefined,
},
{
id: 'routes' as NavTab,