fix: default tailscale serve in settings
This commit is contained in:
@@ -37,7 +37,7 @@ struct TailscaleIntegrationSection: View {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
@State private var hasLoaded = false
|
@State private var hasLoaded = false
|
||||||
@State private var tailscaleMode: GatewayTailscaleMode = .off
|
@State private var tailscaleMode: GatewayTailscaleMode = .serve
|
||||||
@State private var requireCredentialsForServe = false
|
@State private var requireCredentialsForServe = false
|
||||||
@State private var password: String = ""
|
@State private var password: String = ""
|
||||||
@State private var statusMessage: String?
|
@State private var statusMessage: String?
|
||||||
@@ -104,8 +104,8 @@ struct TailscaleIntegrationSection: View {
|
|||||||
.disabled(self.connectionMode != .local)
|
.disabled(self.connectionMode != .local)
|
||||||
.task {
|
.task {
|
||||||
guard !self.hasLoaded else { return }
|
guard !self.hasLoaded else { return }
|
||||||
self.hasLoaded = true
|
|
||||||
self.loadConfig()
|
self.loadConfig()
|
||||||
|
self.hasLoaded = true
|
||||||
await self.effectiveService.checkTailscaleStatus()
|
await self.effectiveService.checkTailscaleStatus()
|
||||||
self.startStatusTimer()
|
self.startStatusTimer()
|
||||||
}
|
}
|
||||||
@@ -245,7 +245,7 @@ struct TailscaleIntegrationSection: View {
|
|||||||
private func loadConfig() {
|
private func loadConfig() {
|
||||||
let gateway = ClawdisConfigFile.loadGatewayDict()
|
let gateway = ClawdisConfigFile.loadGatewayDict()
|
||||||
let tailscale = gateway["tailscale"] as? [String: Any] ?? [:]
|
let tailscale = gateway["tailscale"] as? [String: Any] ?? [:]
|
||||||
let modeRaw = (tailscale["mode"] as? String) ?? "off"
|
let modeRaw = (tailscale["mode"] as? String) ?? "serve"
|
||||||
self.tailscaleMode = GatewayTailscaleMode(rawValue: modeRaw) ?? .off
|
self.tailscaleMode = GatewayTailscaleMode(rawValue: modeRaw) ?? .off
|
||||||
|
|
||||||
let auth = gateway["auth"] as? [String: Any] ?? [:]
|
let auth = gateway["auth"] as? [String: Any] ?? [:]
|
||||||
|
|||||||
Reference in New Issue
Block a user