feat(monitors): 实现 CPU 内存采样诊断与菜单栏实时指标
接入 Mach CPU 差分、内存与负载采样、暂停恢复及按需诊断,合并菜单栏单一原生标题的显示修复。 保留核心检查和本机交互验收记录;长期资源预算仍待验收。
This commit is contained in:
@@ -7,14 +7,20 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
/// 菜单栏弹出面板:后续将在这里展示 CPU / 内存 / 磁盘 / 网络等实时监控数据。
|
||||
/// A 阶段临时面板:展示采样时间与暂停入口,正式面板在 B 阶段实现。
|
||||
struct MenuPanelView: View {
|
||||
let metrics: MetricsStore
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
Label("Kymo 资源监控", systemImage: "gauge")
|
||||
.font(.headline)
|
||||
|
||||
Text("监控面板开发中,敬请期待…")
|
||||
Text(metrics.snapshot.date, style: .time)
|
||||
Button(metrics.isPaused ? "继续监控" : "暂停监控") {
|
||||
metrics.togglePause()
|
||||
}
|
||||
Text("GPU 暂不可用")
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
@@ -24,5 +30,5 @@ struct MenuPanelView: View {
|
||||
}
|
||||
|
||||
#Preview {
|
||||
MenuPanelView()
|
||||
MenuPanelView(metrics: MetricsStore())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user