Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions NetBird/Source/App/Views/Components/RouteCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ struct RouteCard: View {
var body: some View {
HStack {
HStack {
RoundedRectangle(cornerRadius: 8)
.fill(statusIndicatorColor)
.frame(width: 8, height: 40)

VStack(alignment: .leading) {
Text(route.name)
.foregroundColor(Color("TextPeerCard"))
Expand Down Expand Up @@ -96,14 +92,6 @@ struct RouteCard: View {
)
}

private var statusIndicatorColor: Color {
Comment thread
theodorsm marked this conversation as resolved.
guard route.selected else { return Color.gray.opacity(0.5) }

// Status is computed by the core, which correctly handles merged exit nodes
// (v4/v6 pair) and dynamic routes; the UI just reflects it.
return route.status == "Connected" ? Color.green : Color.yellow
}

private var routeDisplayText: String {
if let domains = route.domains, !domains.isEmpty {
if domains.count > 2 {
Expand Down
6 changes: 2 additions & 4 deletions NetbirdKit/RoutesSelectionDetails.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ class RoutesSelectionInfo: ObservableObject, Codable, Identifiable {
var network: String?
var domains: [DomainDetails]?
var selected: Bool
// Connection status computed by the core ("Connected"/"Idle"). UI consumers read
// it directly (e.g. RouteCard.statusIndicatorColor uses route.status); there is no
// network-string fallback. A nil/empty value from an older core is treated as
// not-connected, so a selected route shows the yellow ("unknown") indicator.
// Connection status computed by the core ("Connected"/"Idle"). A nil/empty value
// from an older core is treated as not-connected.
var status: String?

init(id: UUID = UUID(), name: String, network: String?, domains: [DomainDetails]?, selected: Bool, status: String? = nil) {
Expand Down
Loading