UI: streamline relay status label
parent
1190b9c278
commit
2abc51789e
|
|
@ -89,13 +89,23 @@ private struct MenuContent: View {
|
||||||
Circle()
|
Circle()
|
||||||
.fill(self.statusColor(status))
|
.fill(self.statusColor(status))
|
||||||
.frame(width: 8, height: 8)
|
.frame(width: 8, height: 8)
|
||||||
Text(status.label)
|
Text(self.relayLabel(status))
|
||||||
.font(.caption.weight(.semibold))
|
.font(.caption.weight(.semibold))
|
||||||
.foregroundStyle(.primary)
|
.foregroundStyle(.primary)
|
||||||
}
|
}
|
||||||
.padding(.vertical, 4)
|
.padding(.vertical, 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func relayLabel(_ status: RelayProcessManager.Status) -> String {
|
||||||
|
switch status {
|
||||||
|
case .running: return "Running"
|
||||||
|
case .starting: return "Starting…"
|
||||||
|
case .restarting: return "Restarting…"
|
||||||
|
case let .failed(reason): return "Failed: \(reason)"
|
||||||
|
case .stopped: return "Stopped"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private var healthStatusRow: some View {
|
private var healthStatusRow: some View {
|
||||||
let state = self.healthStore.state
|
let state = self.healthStore.state
|
||||||
return HStack(spacing: 8) {
|
return HStack(spacing: 8) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue