Compare commits
9
Commits
main
..
57e2ddd225
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57e2ddd225 | ||
|
|
33bee371f1 | ||
|
|
bb91042da7 | ||
|
|
f8f2cc0b90 | ||
|
|
9f5481a1a9 | ||
|
|
5676279a4c | ||
|
|
7ba4284be1 | ||
|
|
01e871dc2c | ||
|
|
beabf016b0 |
@@ -4,9 +4,8 @@ import SwiftUI
|
||||
|
||||
/// Sidebar tab showing currently breached thresholds and the in-app
|
||||
/// alert history log maintained by `AlertEngine`.
|
||||
@MainActor
|
||||
public struct AlertsView: View {
|
||||
@ObservedObject private var engine = AlertEngine.shared
|
||||
@State private var engine = AlertEngine.shared
|
||||
|
||||
public init() {}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import SwiftUI
|
||||
|
||||
@MainActor
|
||||
public struct ContentView: View {
|
||||
@StateObject private var store = SystemTelemetryStore.shared
|
||||
@State private var selectedTab: String? = "Dashboard"
|
||||
@@ -169,7 +168,7 @@ public struct ContentView: View {
|
||||
}
|
||||
.padding(24)
|
||||
}
|
||||
.navigationTitle("MacMonitor — \(selectedTab ?? "Dashboard")")
|
||||
.navigationTitle("MacMonitor — \(selectedTab)")
|
||||
}
|
||||
|
||||
// MARK: - Dashboard Composite View
|
||||
@@ -1006,6 +1005,8 @@ public struct ContentView: View {
|
||||
HStack {
|
||||
Text("Target Architecture:").foregroundStyle(.secondary)
|
||||
Text("Intel x86_64").bold()
|
||||
Text("Deployment Target:").foregroundStyle(.secondary)
|
||||
Text("macOS 14.0 (Sonoma)").bold()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1219,7 +1220,6 @@ public struct ContentView: View {
|
||||
}
|
||||
|
||||
// MARK: - Process Detail Inspector Sheet
|
||||
@MainActor
|
||||
struct ProcessDetailSheet: View {
|
||||
let inspector: MMProcessDetailInspector
|
||||
let pid: Int32
|
||||
@@ -1248,9 +1248,8 @@ struct ProcessDetailSheet: View {
|
||||
if selectedDetailTab == "Threads" {
|
||||
List(threads.indices, id: \.self) { idx in
|
||||
let t = threads[idx]
|
||||
let threadID = "\(t["threadID"] ?? idx)"
|
||||
HStack {
|
||||
Text("Thread \(threadID)").bold()
|
||||
Text("Thread \(t["threadID"] ?? idx)").bold()
|
||||
Spacer()
|
||||
Text("CPU: \(String(format: "%.1f%%", (t["cpuPercent"] as? Double) ?? 0.0))").monospacedDigit()
|
||||
Text(t["state"] as? String ?? "").foregroundStyle(.secondary)
|
||||
@@ -1263,15 +1262,10 @@ struct ProcessDetailSheet: View {
|
||||
} else {
|
||||
List(sockets.indices, id: \.self) { idx in
|
||||
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 {
|
||||
Text(proto).bold()
|
||||
Text(s["protocol"] as? String ?? "TCP").bold()
|
||||
Spacer()
|
||||
Text("\(localAddr):\(localPort) → \(remoteAddr):\(remotePort)")
|
||||
Text("\(s["localAddress"] ?? ""):\(s["localPort"] ?? 0) → \(s["remoteAddress"] ?? ""):\(s["remotePort"] ?? 0)")
|
||||
.mmMonospaced()
|
||||
Text(s["tcpState"] as? String ?? "").foregroundStyle(.secondary)
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import SwiftUI
|
||||
|
||||
@MainActor
|
||||
public struct QuickGlancePopoverView: View {
|
||||
@ObservedObject var store: SystemTelemetryStore
|
||||
var store: SystemTelemetryStore
|
||||
|
||||
public init(store: SystemTelemetryStore) {
|
||||
self.store = store
|
||||
|
||||
@@ -5,7 +5,6 @@ import UserNotifications
|
||||
|
||||
/// Preferences UI for threshold alert rules. Bound directly to
|
||||
/// `AlertEngine.shared.configuration`, which auto-persists to `UserDefaults`.
|
||||
@MainActor
|
||||
public struct AlertsSettingsView: View {
|
||||
@ObservedObject private var engine = AlertEngine.shared
|
||||
@State private var authorizationStatus: UNAuthorizationStatus = .notDetermined
|
||||
|
||||
@@ -2,7 +2,6 @@ import XCTest
|
||||
import SwiftUI
|
||||
@testable import MacMonitor
|
||||
|
||||
@MainActor
|
||||
final class MMMenuBarTests: XCTestCase {
|
||||
|
||||
func testMenuBarStatusViewInitialization() {
|
||||
|
||||
Reference in New Issue
Block a user