Add proxy subscription runtime support
Add daemon RPCs, Apple and GTK import flows, packet proxy runtime support, diagnostics, and BEPs for proxy subscription handling. Redact subscription URL secrets from fetch errors before they reach logs or UI surfaces.
This commit is contained in:
parent
97c569fb35
commit
d1638726ca
46 changed files with 15079 additions and 456 deletions
|
|
@ -2,6 +2,18 @@ import SwiftUI
|
|||
|
||||
struct NetworkCarouselView: View {
|
||||
var networks: [NetworkCardModel]
|
||||
var selectedNetworkID: Int32?
|
||||
var onSelect: ((NetworkCardModel) -> Void)?
|
||||
|
||||
init(
|
||||
networks: [NetworkCardModel],
|
||||
selectedNetworkID: Int32? = nil,
|
||||
onSelect: ((NetworkCardModel) -> Void)? = nil
|
||||
) {
|
||||
self.networks = networks
|
||||
self.selectedNetworkID = selectedNetworkID
|
||||
self.onSelect = onSelect
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
|
|
@ -29,10 +41,19 @@ struct NetworkCarouselView: View {
|
|||
.frame(maxWidth: .infinity, minHeight: 175)
|
||||
#endif
|
||||
} else {
|
||||
#if os(macOS)
|
||||
LazyVStack(alignment: .leading, spacing: 12) {
|
||||
ForEach(networks) { network in
|
||||
networkCard(network)
|
||||
.frame(maxWidth: 560)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
#else
|
||||
ScrollView(.horizontal) {
|
||||
LazyHStack {
|
||||
ForEach(networks) { network in
|
||||
NetworkView(network: network)
|
||||
networkCard(network)
|
||||
.containerRelativeFrame(.horizontal, count: 10, span: 7, spacing: 0, alignment: .center)
|
||||
.scrollTransition(.interactive, axis: .horizontal) { content, phase in
|
||||
content
|
||||
|
|
@ -47,9 +68,33 @@ struct NetworkCarouselView: View {
|
|||
.defaultScrollAnchor(.center)
|
||||
.scrollTargetBehavior(.viewAligned)
|
||||
.containerRelativeFrame(.horizontal)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private func networkCard(_ network: NetworkCardModel) -> some View {
|
||||
if let onSelect {
|
||||
Button {
|
||||
onSelect(network)
|
||||
} label: {
|
||||
NetworkView(network: network)
|
||||
.overlay(selectionOverlay(for: network))
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
} else {
|
||||
NetworkView(network: network)
|
||||
}
|
||||
}
|
||||
|
||||
private func selectionOverlay(for network: NetworkCardModel) -> some View {
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.stroke(
|
||||
selectedNetworkID == network.id ? Color.accentColor : Color.clear,
|
||||
lineWidth: 3
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue