- Adaptive iPhone/iPad layout with NavigationSplitView sidebar - Auto-detect SSL-pinned domains, fall back to passthrough - Certificate install via local HTTP server (Safari profile flow) - App Group-backed CA, per-domain leaf cert LRU cache - DB-backed config repository, Darwin notification throttling - Rules engine, breakpoint rules, pinned domain tracking - os.Logger instrumentation across tunnel/proxy/mitm/capture/cert/rules/db/ipc/ui - Fix dyld framework embed, race conditions, thread safety
60 lines
2.1 KiB
Swift
60 lines
2.1 KiB
Swift
import SwiftUI
|
|
|
|
struct QueryEditorSheet: View {
|
|
@State var parameters: [(key: String, value: String)]
|
|
let onSave: ([(key: String, value: String)]) -> Void
|
|
@Environment(\.dismiss) private var dismiss
|
|
|
|
var body: some View {
|
|
NavigationStack {
|
|
List {
|
|
ForEach(parameters.indices, id: \.self) { index in
|
|
HStack(spacing: 8) {
|
|
TextField("Key", text: Binding(
|
|
get: { parameters[index].key },
|
|
set: { parameters[index].key = $0 }
|
|
))
|
|
.textInputAutocapitalization(.never)
|
|
.autocorrectionDisabled()
|
|
.font(.subheadline)
|
|
|
|
TextField("Value", text: Binding(
|
|
get: { parameters[index].value },
|
|
set: { parameters[index].value = $0 }
|
|
))
|
|
.textInputAutocapitalization(.never)
|
|
.autocorrectionDisabled()
|
|
.font(.subheadline)
|
|
}
|
|
}
|
|
.onDelete { indexSet in
|
|
parameters.remove(atOffsets: indexSet)
|
|
}
|
|
|
|
Button {
|
|
parameters.append((key: "", value: ""))
|
|
} label: {
|
|
Label("Add Parameter", systemImage: "plus.circle.fill")
|
|
}
|
|
}
|
|
.navigationTitle("Edit Query Parameters")
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
.toolbar {
|
|
ToolbarItem(placement: .topBarLeading) {
|
|
Button("Cancel") {
|
|
dismiss()
|
|
}
|
|
}
|
|
ToolbarItem(placement: .topBarTrailing) {
|
|
Button("Done") {
|
|
let filtered = parameters.filter { !$0.key.isEmpty }
|
|
onSave(filtered)
|
|
dismiss()
|
|
}
|
|
.fontWeight(.semibold)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|