ui: move health/cli info to Debug; add single health row in General
This commit is contained in:
@@ -9,6 +9,7 @@ struct DebugSettings: View {
|
|||||||
@State private var modelsLoading = false
|
@State private var modelsLoading = false
|
||||||
@State private var modelsError: String?
|
@State private var modelsError: String?
|
||||||
@ObservedObject private var relayManager = RelayProcessManager.shared
|
@ObservedObject private var relayManager = RelayProcessManager.shared
|
||||||
|
@ObservedObject private var healthStore = HealthStore.shared
|
||||||
@State private var relayRootInput: String = RelayProcessManager.shared.projectRootPath()
|
@State private var relayRootInput: String = RelayProcessManager.shared.projectRootPath()
|
||||||
@State private var sessionStorePath: String = SessionLoader.defaultStorePath
|
@State private var sessionStorePath: String = SessionLoader.defaultStorePath
|
||||||
@State private var sessionStoreSaveError: String?
|
@State private var sessionStoreSaveError: String?
|
||||||
@@ -19,6 +20,18 @@ struct DebugSettings: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView(.vertical) {
|
ScrollView(.vertical) {
|
||||||
VStack(alignment: .leading, spacing: 10) {
|
VStack(alignment: .leading, spacing: 10) {
|
||||||
|
LabeledContent("Health") {
|
||||||
|
HStack(spacing: 8) {
|
||||||
|
Circle().fill(self.healthStore.state.tint).frame(width: 10, height: 10)
|
||||||
|
Text(self.healthStore.summaryLine)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LabeledContent("CLI helper") {
|
||||||
|
let loc = CLIInstaller.installedLocation()
|
||||||
|
Text(loc ?? "missing")
|
||||||
|
.font(.caption.monospaced())
|
||||||
|
.foregroundStyle(loc == nil ? Color.red : Color.secondary)
|
||||||
|
}
|
||||||
LabeledContent("PID") { Text("\(ProcessInfo.processInfo.processIdentifier)") }
|
LabeledContent("PID") { Text("\(ProcessInfo.processInfo.processIdentifier)") }
|
||||||
LabeledContent("Log file") {
|
LabeledContent("Log file") {
|
||||||
Button("Open pino log") { self.openLog() }
|
Button("Open pino log") { self.openLog() }
|
||||||
|
|||||||
@@ -61,17 +61,7 @@ var body: some View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
self.healthRow
|
||||||
Text("Health")
|
|
||||||
.font(.callout.weight(.semibold))
|
|
||||||
self.healthCard
|
|
||||||
}
|
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 6) {
|
|
||||||
Text("CLI helper")
|
|
||||||
.font(.callout.weight(.semibold))
|
|
||||||
self.cliInstaller
|
|
||||||
}
|
|
||||||
|
|
||||||
Spacer(minLength: 12)
|
Spacer(minLength: 12)
|
||||||
HStack {
|
HStack {
|
||||||
@@ -317,6 +307,16 @@ private enum RemoteStatus: Equatable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension GeneralSettings {
|
extension GeneralSettings {
|
||||||
|
private var healthRow: some View {
|
||||||
|
HStack(spacing: 10) {
|
||||||
|
Circle()
|
||||||
|
.fill(self.healthStore.state.tint)
|
||||||
|
.frame(width: 10, height: 10)
|
||||||
|
Text(self.healthStore.summaryLine)
|
||||||
|
.font(.callout)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
fileprivate func testRemote() async {
|
fileprivate func testRemote() async {
|
||||||
self.remoteStatus = .checking
|
self.remoteStatus = .checking
|
||||||
|
|||||||
Reference in New Issue
Block a user