ServerConfig parses https base URL and derives wss livekit URL; TokenClient POSTs /token with clean 503/offline error states; TLSPinning holds optional cert SHA-384 pins (empty = system trust); Settings gains a Connection test screen proving the endpoint works.
34 lines
971 B
Swift
34 lines
971 B
Swift
import SwiftUI
|
|
|
|
struct SettingsView: View {
|
|
@ObservedObject var settings: SettingsStore
|
|
@State private var urlText: String = ""
|
|
|
|
var body: some View {
|
|
Form {
|
|
Section("Server") {
|
|
TextField("https://192.168.86.2:9178", text: $urlText)
|
|
.keyboardType(.URL)
|
|
.autocorrectionDisabled()
|
|
.onAppear { urlText = settings.serverURL }
|
|
.onChange(of: urlText) { _, newValue in
|
|
settings.serverURL = newValue
|
|
}
|
|
}
|
|
Section("Interaction") {
|
|
Toggle("Text mode", isOn: $settings.textMode)
|
|
}
|
|
Section {
|
|
NavigationLink("Connection test") {
|
|
ConnectionTestView(settings: settings)
|
|
}
|
|
}
|
|
}
|
|
.navigationTitle("Settings")
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
SettingsView(settings: SettingsStore())
|
|
}
|