接入 Mach CPU 差分、内存与负载采样、暂停恢复及按需诊断,合并菜单栏单一原生标题的显示修复。 保留核心检查和本机交互验收记录;长期资源预算仍待验收。
35 lines
866 B
Swift
35 lines
866 B
Swift
//
|
|
// MenuPanelView.swift
|
|
// kymo
|
|
//
|
|
// Created by Airnan on 2026/10/29.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
/// A 阶段临时面板:展示采样时间与暂停入口,正式面板在 B 阶段实现。
|
|
struct MenuPanelView: View {
|
|
let metrics: MetricsStore
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 12) {
|
|
Label("Kymo 资源监控", systemImage: "gauge")
|
|
.font(.headline)
|
|
|
|
Text(metrics.snapshot.date, style: .time)
|
|
Button(metrics.isPaused ? "继续监控" : "暂停监控") {
|
|
metrics.togglePause()
|
|
}
|
|
Text("GPU 暂不可用")
|
|
.font(.subheadline)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
.padding(16)
|
|
.frame(width: 280, alignment: .leading)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
MenuPanelView(metrics: MetricsStore())
|
|
}
|