diff --git a/manet-30ns3/web-manager/src/sections/Dashboard.tsx b/manet-30ns3/web-manager/src/sections/Dashboard.tsx index 842d09f..1b39f9a 100644 --- a/manet-30ns3/web-manager/src/sections/Dashboard.tsx +++ b/manet-30ns3/web-manager/src/sections/Dashboard.tsx @@ -4,7 +4,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip import type { SimulationStatus, FlowStats, NodeStatus } from '@/types/config'; import { Activity, ArrowDownToLine, ArrowUpFromLine, Info, Radio, - Wifi, Router, Zap, TrendingUp, TrendingDown, + Zap, } from 'lucide-react'; interface DashboardProps { @@ -22,49 +22,6 @@ interface DashboardProps { }; } -interface StatCardProps { - label: string; - value: string | number; - subValue?: string; - icon: React.ReactNode; - iconBg: string; - trend?: 'up' | 'down' | 'neutral'; - tooltip?: string; -} - -function StatCard({ label, value, subValue, icon, iconBg, trend, tooltip }: StatCardProps) { - return ( - - -
-
-
-

{label}

-
- {value} - {trend && trend !== 'neutral' && ( - trend === 'up' - ? - : - )} -
- {subValue &&

{subValue}

} -
-
- {icon} -
-
-
-
- {tooltip && ( - - {tooltip} - - )} -
- ); -} - export function Dashboard({ status, flows, nodes, config }: DashboardProps) { const totalTx = flows.reduce((sum, f) => sum + f.txPackets, 0); const totalLost = flows.reduce((sum, f) => sum + f.lostPackets, 0); @@ -73,9 +30,6 @@ export function Dashboard({ status, flows, nodes, config }: DashboardProps) { const totalRxNodes = nodes.reduce((sum, n) => sum + n.rxPackets, 0); const totalTxNodes = nodes.reduce((sum, n) => sum + n.txPackets, 0); - const onlineNodes = nodes.filter(n => n.status === 'online').length; - const activeFlowCount = flows.filter(f => f.txPackets > 0).length; - return (
{/* Status Banner */} @@ -148,42 +102,6 @@ export function Dashboard({ status, flows, nodes, config }: DashboardProps) {
- {/* Stat Cards Grid */} -
- } - iconBg="bg-success/10" - tooltip="当前处于 online 状态的节点数量" - /> - } - iconBg="bg-primary/10" - tooltip="当前有数据包发送的活跃流量数" - /> - 1000 ? `${(totalTxNodes / 1000).toFixed(1)}k` : totalTxNodes} - subValue="packets" - icon={} - iconBg="bg-cyan-500/10" - tooltip="所有节点 WifiNetDevice 发送包总数" - /> - 1000 ? `${(totalRxNodes / 1000).toFixed(1)}k` : totalRxNodes} - subValue="packets" - icon={} - iconBg="bg-violet-500/10" - tooltip="所有节点 WifiNetDevice 接收包总数(含广播重复计数)" - /> -
- {/* MAC Layer Overhead Estimation */} {config && (