Compare commits
2
Commits
68e6df2938
...
05669f1b41
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05669f1b41 | ||
|
|
8dafffdd6e |
@@ -169,7 +169,7 @@ public struct ContentView: View {
|
|||||||
}
|
}
|
||||||
.padding(24)
|
.padding(24)
|
||||||
}
|
}
|
||||||
.navigationTitle("MacMonitor — \(selectedTab)")
|
.navigationTitle("MacMonitor — \(selectedTab ?? "Dashboard")")
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Dashboard Composite View
|
// MARK: - Dashboard Composite View
|
||||||
@@ -1250,8 +1250,9 @@ struct ProcessDetailSheet: View {
|
|||||||
if selectedDetailTab == "Threads" {
|
if selectedDetailTab == "Threads" {
|
||||||
List(threads.indices, id: \.self) { idx in
|
List(threads.indices, id: \.self) { idx in
|
||||||
let t = threads[idx]
|
let t = threads[idx]
|
||||||
|
let threadID = "\(t["threadID"] ?? idx)"
|
||||||
HStack {
|
HStack {
|
||||||
Text("Thread \(t["threadID"] ?? idx)").bold()
|
Text("Thread \(threadID)").bold()
|
||||||
Spacer()
|
Spacer()
|
||||||
Text("CPU: \(String(format: "%.1f%%", (t["cpuPercent"] as? Double) ?? 0.0))").monospacedDigit()
|
Text("CPU: \(String(format: "%.1f%%", (t["cpuPercent"] as? Double) ?? 0.0))").monospacedDigit()
|
||||||
Text(t["state"] as? String ?? "").foregroundStyle(.secondary)
|
Text(t["state"] as? String ?? "").foregroundStyle(.secondary)
|
||||||
@@ -1264,10 +1265,15 @@ struct ProcessDetailSheet: View {
|
|||||||
} else {
|
} else {
|
||||||
List(sockets.indices, id: \.self) { idx in
|
List(sockets.indices, id: \.self) { idx in
|
||||||
let s = sockets[idx]
|
let s = sockets[idx]
|
||||||
|
let proto = s["protocol"] as? String ?? "TCP"
|
||||||
|
let localAddr = (s["localAddress"] as? String) ?? ""
|
||||||
|
let localPort = (s["localPort"] as? Int) ?? 0
|
||||||
|
let remoteAddr = (s["remoteAddress"] as? String) ?? ""
|
||||||
|
let remotePort = (s["remotePort"] as? Int) ?? 0
|
||||||
HStack {
|
HStack {
|
||||||
Text(s["protocol"] as? String ?? "TCP").bold()
|
Text(proto).bold()
|
||||||
Spacer()
|
Spacer()
|
||||||
Text("\(s["localAddress"] ?? ""):\(s["localPort"] ?? 0) → \(s["remoteAddress"] ?? ""):\(s["remotePort"] ?? 0)")
|
Text("\(localAddr):\(localPort) → \(remoteAddr):\(remotePort)")
|
||||||
.mmMonospaced()
|
.mmMonospaced()
|
||||||
Text(s["tcpState"] as? String ?? "").foregroundStyle(.secondary)
|
Text(s["tcpState"] as? String ?? "").foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user