Refactor Dashboard traffic cards with line charts

This commit is contained in:
世界
2025-12-06 21:19:37 +08:00
parent 52efbd97d2
commit 0e206cc452
17 changed files with 299 additions and 93 deletions
@@ -84,7 +84,7 @@ public struct OverviewView: View {
private func shouldShowCard(_ card: DashboardCard) -> Bool {
switch card {
case .status, .connections, .traffic, .trafficTotal, .clashMode:
case .status, .connections, .uploadTraffic, .downloadTraffic, .clashMode:
return ApplicationLibrary.inPreview || profile.status.isConnected
case .httpProxy:
return (ApplicationLibrary.inPreview || profile.status.isConnectedStrict) && systemProxyAvailable
@@ -102,11 +102,11 @@ public struct OverviewView: View {
case .connections:
ConnectionsCard()
.environmentObject(environments.commandClient)
case .traffic:
TrafficCard()
case .uploadTraffic:
UploadTrafficCard()
.environmentObject(environments.commandClient)
case .trafficTotal:
TrafficTotalCard()
case .downloadTraffic:
DownloadTrafficCard()
.environmentObject(environments.commandClient)
case .httpProxy:
HTTPProxyCard(