mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Always show port kill button
This commit is contained in:
parent
8c8e267ea6
commit
e9ef227f8f
1 changed files with 54 additions and 32 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue