Always show port kill button

This commit is contained in:
Peter Steinberger 2025-08-02 18:15:22 +02:00
parent 8c8e267ea6
commit e9ef227f8f

View file

@ -252,7 +252,7 @@ private struct ServerStatusSection: View {
}
}
// Port conflict warning
// Port conflict warning
if let conflict = portConflict {
VStack(alignment: .leading, spacing: 6) {
HStack(spacing: 4) {
@ -285,6 +285,28 @@ private struct ServerStatusSection: View {
}
}
}
// Add kill button for conflicting processes
HStack {
Button("Kill Process") {
Task {
do {
try await PortConflictResolver.shared.forceKillProcess(conflict)
// After killing, clear the conflict and restart the server
portConflict = nil
await serverManager.start()
} catch {
// Handle error - in a real implementation, you might show an alert
print("Failed to kill process: \(error)")
}
}
}
.buttonStyle(.bordered)
.controlSize(.small)
Spacer()
}
.padding(.top, 8)
}
.padding(.vertical, 8)
.padding(.horizontal, 12)