

























@@ -11,6 +11,9 @@ struct GeneralSettings: View {
1111case connection
1212}
131314+private static let remoteFieldWidth: CGFloat = 320
15+private static let remoteSecretFieldWidth: CGFloat = 300
16+1417@Bindable var state: AppState
1518@AppStorage(cameraEnabledKey) private var cameraEnabled: Bool = false
1619let page: Page
@@ -384,6 +387,7 @@ struct GeneralSettings: View {
384387self.applyDiscoveredGateway(gateway)
385388}
386389}
390+.frame(maxWidth: .infinity, alignment: .leading)
387391.padding(.horizontal, 14)
388392.padding(.vertical, 11)
389393.overlay(alignment: .bottom) {
@@ -500,7 +504,7 @@ struct GeneralSettings: View {
500504SettingsCardRow(title: "SSH target", subtitle: "User and host for the remote Gateway machine.") {
501505TextField("user@host[:22]", text: self.$state.remoteTarget)
502506.textFieldStyle(.roundedBorder)
503-.frame(width: 420)
507+.frame(width: Self.remoteFieldWidth)
504508self.remoteTestButton(disabled: !canTest)
505509}
506510if let validationMessage {
@@ -514,20 +518,20 @@ struct GeneralSettings: View {
514518}
515519516520private var remoteDirectRow: some View {
517-VStack(alignment: .leading, spacing: 0) {
518-SettingsCardRow(title: "Gateway URL", subtitle: "The WebSocket URL exposed by the remote Gateway.") {
519-TextField("wss://gateway.example.ts.net", text: self.$state.remoteUrl)
520-.textFieldStyle(.roundedBorder)
521-.frame(width: 420)
522-self.remoteTestButton(
523- disabled: self.state.remoteUrl.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)
521+SettingsCardRow(title: "Gateway URL", subtitle: "The WebSocket URL exposed by the remote Gateway.") {
522+VStack(alignment: .leading, spacing: 6) {
523+HStack(spacing: 8) {
524+TextField("wss://gateway.example.ts.net", text: self.$state.remoteUrl)
525+.textFieldStyle(.roundedBorder)
526+.frame(width: Self.remoteFieldWidth)
527+self.remoteTestButton(
528+ disabled: self.state.remoteUrl.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)
529+}
530+Text("Use wss:// for public hosts. ws:// is allowed for localhost, LAN, .local, and Tailnet hosts.")
531+.font(.caption)
532+.foregroundStyle(.secondary)
533+.fixedSize(horizontal: false, vertical: true)
524534}
525-Text(
526-"Use wss:// for public hosts. ws:// is allowed for localhost, LAN, .local, and Tailnet hosts.")
527-.font(.caption)
528-.foregroundStyle(.secondary)
529-.padding(.horizontal, 14)
530-.padding(.bottom, 10)
531535}
532536}
533537@@ -540,7 +544,7 @@ struct GeneralSettings: View {
540544{
541545SecureField("remote gateway auth token (gateway.remote.token)", text: self.$state.remoteToken)
542546.textFieldStyle(.roundedBorder)
543-.frame(width: 360)
547+.frame(width: Self.remoteSecretFieldWidth)
544548}
545549if self.state.remoteTokenUnsupported {
546550Text(
@@ -566,6 +570,7 @@ struct GeneralSettings: View {
566570}
567571}
568572.buttonStyle(.borderedProminent)
573+.frame(minWidth: 116)
569574.disabled(self.remoteStatus == .checking || disabled)
570575}
571576此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。