✨ feat: add connections page, rename dashboard page to overview
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user