You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.1 KiB
73 lines
2.1 KiB
//
|
|
// DebugSettingsView.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Laurent Morvillier on 28/05/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
import LeStorage
|
|
|
|
struct DebugSettingsView: View {
|
|
var body: some View {
|
|
List {
|
|
|
|
Section("Status") {
|
|
LabeledContent("Has Websocket Manager", value: self._hasWebSocketManager)
|
|
LabeledContent("Websocket ping", value: self._wsPingStatus)
|
|
LabeledContent("Websocket failure", value: self._wsFailure)
|
|
}
|
|
|
|
Section("Settings") {
|
|
LabeledContent("UUID", value: self._userId)
|
|
LabeledContent("User Name", value: self._userName)
|
|
LabeledContent("Token", value: self._token)
|
|
LabeledContent("Server", value: self._apiURL)
|
|
LabeledContent("Synchronized", value: self._synchronized)
|
|
LabeledContent("CollectionsCanSynchronize", value: self._canSynchronize)
|
|
}
|
|
}
|
|
}
|
|
|
|
fileprivate var _userId: String {
|
|
return StoreCenter.main.userId ?? ""
|
|
}
|
|
|
|
fileprivate var _userName: String {
|
|
return StoreCenter.main.userName() ?? ""
|
|
}
|
|
|
|
fileprivate var _token: String {
|
|
return StoreCenter.main.token() ?? ""
|
|
}
|
|
|
|
fileprivate var _apiURL: String {
|
|
return StoreCenter.main.apiURL ?? "not configured"
|
|
}
|
|
|
|
fileprivate var _synchronized: String {
|
|
if let synchronized = PListReader.readBool(plist: "local", key: "synchronized") {
|
|
return "\(synchronized)"
|
|
} else {
|
|
return "not specified"
|
|
}
|
|
}
|
|
|
|
fileprivate var _canSynchronize: String {
|
|
return "\(StoreCenter.main.collectionsCanSynchronize)"
|
|
}
|
|
|
|
fileprivate var _wsPingStatus: String {
|
|
return "\(StoreCenter.main.websocketPingStatus)"
|
|
}
|
|
fileprivate var _wsFailure: String {
|
|
return "\(StoreCenter.main.websocketFailure)"
|
|
}
|
|
fileprivate var _hasWebSocketManager: String {
|
|
return "\(StoreCenter.main.hasWebSocketManager)"
|
|
}
|
|
}
|
|
|
|
//#Preview {
|
|
// DebugSettingsView()
|
|
//}
|
|
|