Add manual kill button

This commit is contained in:
Peter Steinberger 2025-06-19 23:52:23 +02:00
parent 6974e57f15
commit d20b7e6656

View file

@ -689,28 +689,48 @@ private struct PortConfigurationView: View {
.foregroundColor(.orange) .foregroundColor(.orange)
} }
if !conflict.alternativePorts.isEmpty { HStack(spacing: 8) {
HStack(spacing: 4) { if !conflict.alternativePorts.isEmpty {
Text("Try port:") HStack(spacing: 4) {
.font(.caption) Text("Try port:")
.foregroundStyle(.secondary) .font(.caption)
.foregroundStyle(.secondary)
ForEach(conflict.alternativePorts.prefix(3), id: \.self) { port in ForEach(conflict.alternativePorts.prefix(3), id: \.self) { port in
Button(String(port)) { Button(String(port)) {
serverPort = String(port) serverPort = String(port)
portNumber = port portNumber = port
restartServerWithNewPort(port) restartServerWithNewPort(port)
}
.buttonStyle(.link)
.font(.caption)
}
Button("Choose...") {
showPortPicker()
} }
.buttonStyle(.link) .buttonStyle(.link)
.font(.caption) .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) .padding(.vertical, 8)