From d20b7e665646f1ac882afbfc4fba264ab4e5b6a3 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 19 Jun 2025 23:52:23 +0200 Subject: [PATCH] Add manual kill button --- .../Settings/DashboardSettingsView.swift | 52 +++++++++++++------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift b/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift index 922853ff..4d3c2998 100644 --- a/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift +++ b/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift @@ -689,28 +689,48 @@ private struct PortConfigurationView: View { .foregroundColor(.orange) } - if !conflict.alternativePorts.isEmpty { - HStack(spacing: 4) { - Text("Try port:") - .font(.caption) - .foregroundStyle(.secondary) + HStack(spacing: 8) { + if !conflict.alternativePorts.isEmpty { + HStack(spacing: 4) { + Text("Try port:") + .font(.caption) + .foregroundStyle(.secondary) - ForEach(conflict.alternativePorts.prefix(3), id: \.self) { port in - Button(String(port)) { - serverPort = String(port) - portNumber = port - restartServerWithNewPort(port) + ForEach(conflict.alternativePorts.prefix(3), id: \.self) { port in + Button(String(port)) { + serverPort = String(port) + portNumber = port + restartServerWithNewPort(port) + } + .buttonStyle(.link) + .font(.caption) + } + + Button("Choose...") { + showPortPicker() } .buttonStyle(.link) .font(.caption) } - - Button("Choose...") { - showPortPicker() - } - .buttonStyle(.link) - .font(.caption) } + + Spacer() + + Button { + Task { + await forceQuitConflictingProcess(conflict) + } + } label: { + HStack(spacing: 4) { + Image(systemName: "xmark.circle.fill") + .font(.caption) + Text("Kill Process") + .font(.caption) + } + } + .buttonStyle(.borderedProminent) + .controlSize(.small) + .tint(.red) } } .padding(.vertical, 8)