feat(panel): 调整资源卡片读数布局并保留趋势平移

逐核显示 CPU 占用,在 GPU 标题展示核数并补充分项读数。无电池设备显示整机功率。

存储与网络将曲线排在详情下方,CPU、GPU、内存和电池保留整卡趋势。数值直接刷新,曲线随采样平滑平移。顶栏展示版本号,底栏调整开机时间和刷新间隔。
This commit is contained in:
2026-11-15 22:03:46 +08:00
parent c886c4227d
commit 6300db3d15
27 changed files with 427 additions and 250 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ struct IntervalControl: View {
@Binding var milliseconds: Int
var range: ClosedRange<Int> = 500...1_800_000
var step = 100
var fieldWidth: CGFloat = 64
@State private var text = ""
@FocusState private var focused: Bool
@@ -13,7 +14,7 @@ struct IntervalControl: View {
TextField("sampling.seconds", text: $text)
.labelsHidden()
.textFieldStyle(.roundedBorder).multilineTextAlignment(.trailing)
.frame(width: 64).focused($focused)
.frame(width: fieldWidth).focused($focused)
.onChange(of: text) { _, value in
if let seconds = Double(value.replacingOccurrences(of: ",", with: ".")), seconds.isFinite,
seconds >= Double(range.lowerBound) / 1000, seconds <= Double(range.upperBound) / 1000 {