mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Show server PID in settings
This commit is contained in:
parent
6a918aeab6
commit
969fd2e327
3 changed files with 17 additions and 0 deletions
|
|
@ -47,6 +47,11 @@ final class BunServer {
|
||||||
|
|
||||||
var bindAddress: String = "127.0.0.1"
|
var bindAddress: String = "127.0.0.1"
|
||||||
|
|
||||||
|
/// The process identifier of the running server, if available
|
||||||
|
var processIdentifier: Int32? {
|
||||||
|
process?.processIdentifier
|
||||||
|
}
|
||||||
|
|
||||||
/// Local authentication token for bypassing auth on localhost
|
/// Local authentication token for bypassing auth on localhost
|
||||||
private let localAuthToken: String = {
|
private let localAuthToken: String = {
|
||||||
// Generate a secure random token for this session
|
// Generate a secure random token for this session
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,11 @@ class ServerManager {
|
||||||
private(set) var isRestarting = false
|
private(set) var isRestarting = false
|
||||||
private(set) var lastError: Error?
|
private(set) var lastError: Error?
|
||||||
|
|
||||||
|
/// The process ID of the running server, if available
|
||||||
|
var serverProcessId: Int32? {
|
||||||
|
bunServer?.processIdentifier
|
||||||
|
}
|
||||||
|
|
||||||
/// Track if we're in the middle of handling a crash to prevent multiple restarts
|
/// Track if we're in the middle of handling a crash to prevent multiple restarts
|
||||||
private var isHandlingCrash = false
|
private var isHandlingCrash = false
|
||||||
/// Number of consecutive crashes for backoff
|
/// Number of consecutive crashes for backoff
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,13 @@ private struct ServerStatusSection: View {
|
||||||
.font(.system(.body, design: .monospaced))
|
.font(.system(.body, design: .monospaced))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let pid = serverManager.serverProcessId {
|
||||||
|
LabeledContent("Process ID") {
|
||||||
|
Text("\(pid)")
|
||||||
|
.font(.system(.body, design: .monospaced))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue