perf(efficiency): 落实首批采样减负与发行包瘦身
This commit is contained in:
@@ -47,14 +47,14 @@ struct MenuPanelView: View {
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: PanelStyle.gap) {
|
||||
header
|
||||
if PanelResourceAudit.omitted != "header" { header }
|
||||
if PanelLayout.needsResourceScroll(size: panelSize, rows: rowHeights) {
|
||||
ScrollView { resourceRows }
|
||||
.frame(maxHeight: PanelLayout.resourceHeight(rows: rowHeights))
|
||||
} else {
|
||||
resourceRows
|
||||
}
|
||||
if metrics.isPanelVisible {
|
||||
if metrics.isPanelVisible && PanelResourceAudit.omitted != "processes" {
|
||||
ProcessTableView(snapshot: snapshot.processes, wide: panelSize.width >= 900).frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.frame(minHeight: 170)
|
||||
}
|
||||
@@ -98,14 +98,18 @@ struct MenuPanelView: View {
|
||||
}
|
||||
|
||||
@ViewBuilder private func resourceCard(at index: Int) -> some View {
|
||||
switch index {
|
||||
case 0: cpuCard
|
||||
case 1: gpuCard
|
||||
case 2: batteryCard
|
||||
case 3: memoryCard
|
||||
case 4: diskCard
|
||||
case 5: networkCard
|
||||
default: EmptyView()
|
||||
if PanelResourceAudit.omitted == "resources" {
|
||||
Color.clear
|
||||
} else {
|
||||
switch index {
|
||||
case 0: cpuCard
|
||||
case 1: gpuCard
|
||||
case 2: batteryCard
|
||||
case 3: memoryCard
|
||||
case 4: diskCard
|
||||
case 5: networkCard
|
||||
default: EmptyView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user