Show both sign-ins on the first screen and find servers automatically

This commit is contained in:
Ian Gulliver
2026-10-20 14:08:35 -07:00
parent a728cb2c96
commit da7f952855
7 changed files with 130 additions and 48 deletions
+2 -21
View File
@@ -23,26 +23,6 @@ struct ServerState {
let noCertificates = "byre's Tailscale node is signed in, but the tailnet has no HTTPS certificates, so byre can't serve its API. Turn on HTTPS Certificates on the DNS page of Tailscale's admin console, https://login.tailscale.com/admin/dns, then turn the server off and on in the Server tab."
struct ServiceLoginView: View {
let info: TailnetInfo
var body: some View {
VStack(alignment: .leading, spacing: 6) {
Text("byre's server on this Mac has its own Tailscale node, \(info.hostname). Sign it in to the same tailnet.")
.fixedSize(horizontal: false, vertical: true)
Button("Sign in to Tailscale") {
if let url = URL(string: info.authUrl) {
NSWorkspace.shared.open(url)
}
}
.buttonStyle(WebButtonStyle())
.disabled(URL(string: info.authUrl) == nil)
Text("Waiting for the sign-in (\(info.state))…")
.foregroundStyle(Palette.muted)
}
}
}
struct Check: Decodable {
let name: String
let need: String
@@ -478,7 +458,8 @@ struct ServerView: View {
.textSelection(.enabled)
.fixedSize(horizontal: false, vertical: true)
} else if let tailnet = state.tailnet {
ServiceLoginView(info: tailnet)
Text("Tailscale node \(tailnet.hostname): \(tailnet.state)")
.foregroundStyle(Palette.muted)
} else {
Text("Not answering at \(loopback?.absoluteString ?? "its loopback address") yet.")
.foregroundStyle(Palette.muted)