Add an iPhone client sharing the macOS app's SwiftUI code
This commit is contained in:
@@ -6,6 +6,11 @@ typealias Permission = Components.Schemas.Permission
|
||||
typealias UsageCommands = Components.Schemas.UsageCommands
|
||||
typealias TailnetInfo = Components.Schemas.Tailnet
|
||||
|
||||
struct ProcessFailure: LocalizedError {
|
||||
let errorDescription: String?
|
||||
}
|
||||
|
||||
#if os(macOS)
|
||||
let serverHelper = Bundle.main.bundleURL.appending(path: "Contents/Helpers/byre").path
|
||||
private let service = "gui/\(getuid())/run.fc.byre"
|
||||
|
||||
@@ -121,8 +126,7 @@ private struct CommandBox: View {
|
||||
}
|
||||
|
||||
private func copy() {
|
||||
NSPasteboard.general.clearContents()
|
||||
NSPasteboard.general.setString(command, forType: .string)
|
||||
copyToClipboard(command)
|
||||
copied = true
|
||||
Task {
|
||||
try? await Task.sleep(for: .milliseconds(1500))
|
||||
@@ -293,10 +297,6 @@ private struct UsageCommandsForm: View {
|
||||
}
|
||||
}
|
||||
|
||||
struct ProcessFailure: LocalizedError {
|
||||
let errorDescription: String?
|
||||
}
|
||||
|
||||
private func execute(_ path: String, _ args: [String], env: [String: String] = [:]) async throws -> (status: Int32, output: String) {
|
||||
try await Task.detached {
|
||||
let p = Process()
|
||||
@@ -386,13 +386,13 @@ struct ServerView: View {
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
Text("Server on \(macName)")
|
||||
Text("Server on \(deviceName)")
|
||||
.font(Fonts.font(13, weight: 700))
|
||||
.padding(.top, 16)
|
||||
if let state {
|
||||
details(state)
|
||||
}
|
||||
Text("Tools on \(macName)")
|
||||
Text("Tools on \(deviceName)")
|
||||
.font(Fonts.font(13, weight: 700))
|
||||
.padding(.top, 16)
|
||||
switch checks {
|
||||
@@ -513,3 +513,4 @@ struct ServerView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user