c08fc277a9
A native macOS network monitor that renders live traffic as a top-down neon city: your Mac is downtown, remote orgs are glowing districts, and traffic is cars of light driving the roads. Architecture: - NetworkCityCore: swappable data layer behind a ConnectionSource protocol (nettop-backed today), plus pure/tested logic — traffic diffing, org classification (reverse-DNS + CIDR), traffic classes, hub-and-spoke expansion policy, label anti-overlap, and latency→distance layout. - NetworkCityApp: SwiftUI + SpriteKit city — auto-expanding districts, protocol-coloured cars, click-to-inspect panel, and latency-as-distance (districts glide to their measured RTT). - nettop-probe: CLI proof of the data layer. 44 tests passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
26 lines
673 B
Swift
26 lines
673 B
Swift
import NetworkCityCore
|
|
|
|
/// One endpoint's live detail for the inspector panel.
|
|
struct EndpointInfo: Identifiable {
|
|
var id: String { host }
|
|
let host: String
|
|
let rdns: String?
|
|
let downKBs: Double
|
|
let upKBs: Double
|
|
let topClass: TrafficClass
|
|
let rttMs: Double?
|
|
}
|
|
|
|
/// A live snapshot of one district, shown when its hub is clicked. Rebuilt each
|
|
/// tick while selected so the panel updates in real time.
|
|
struct OrgInspection: Identifiable {
|
|
var id: String { key }
|
|
let key: String
|
|
let title: String
|
|
let downKBs: Double
|
|
let upKBs: Double
|
|
let endpointCount: Int
|
|
let endpoints: [EndpointInfo]
|
|
let processes: [String]
|
|
}
|