Show both sign-ins on the first screen and find servers automatically
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user