mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 15:44:32 +00:00
Working StatsPanel, need to refine StatsUI
This commit is contained in:
parent
85c7785851
commit
6ae389950d
8 changed files with 1116 additions and 4 deletions
|
|
@ -1115,6 +1115,7 @@ struct Shortcuts: View {
|
|||
@Default(.enableTimerFeature) var enableTimerFeature
|
||||
@Default(.enableClipboardManager) var enableClipboardManager
|
||||
@Default(.enableShortcuts) var enableShortcuts
|
||||
@Default(.enableStatsFeature) var enableStatsFeature
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
|
|
@ -1199,6 +1200,34 @@ struct Shortcuts: View {
|
|||
.foregroundStyle(.secondary)
|
||||
.font(.caption)
|
||||
}
|
||||
|
||||
Section {
|
||||
HStack {
|
||||
VStack(alignment: .leading) {
|
||||
KeyboardShortcuts.Recorder("Stats Panel:", name: .statsPanel)
|
||||
.disabled(!enableShortcuts || !enableStatsFeature || !Defaults[.showStatsPanel])
|
||||
if !enableStatsFeature {
|
||||
Text("Stats feature is disabled")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.top, 2)
|
||||
} else if !Defaults[.showStatsPanel] {
|
||||
Text("Stats panel is disabled")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.top, 2)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
} header: {
|
||||
Text("Stats")
|
||||
} footer: {
|
||||
Text("Opens the detailed system performance monitor panel. Default is Cmd+Shift+S. Only works when stats feature is enabled.")
|
||||
.multilineTextAlignment(.trailing)
|
||||
.foregroundStyle(.secondary)
|
||||
.font(.caption)
|
||||
}
|
||||
} else {
|
||||
Section {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
|
|
@ -1423,6 +1452,7 @@ struct StatsSettings: View {
|
|||
@Default(.showGpuGraph) var showGpuGraph
|
||||
@Default(.showNetworkGraph) var showNetworkGraph
|
||||
@Default(.showDiskGraph) var showDiskGraph
|
||||
@Default(.showStatsPanel) var showStatsPanel
|
||||
|
||||
var enabledGraphsCount: Int {
|
||||
[showCpuGraph, showMemoryGraph, showGpuGraph, showNetworkGraph, showDiskGraph].filter { $0 }.count
|
||||
|
|
@ -1439,13 +1469,24 @@ struct StatsSettings: View {
|
|||
statsManager.stopMonitoring()
|
||||
}
|
||||
}
|
||||
|
||||
if enableStatsFeature {
|
||||
Defaults.Toggle("Enable detailed stats panel", key: .showStatsPanel)
|
||||
}
|
||||
} header: {
|
||||
Text("General")
|
||||
} footer: {
|
||||
Text("When enabled, the Stats tab will display real-time system performance graphs. This feature requires system permissions and may use additional battery.")
|
||||
.multilineTextAlignment(.trailing)
|
||||
.foregroundStyle(.secondary)
|
||||
.font(.caption)
|
||||
if enableStatsFeature && showStatsPanel {
|
||||
Text("Stats monitoring displays performance graphs in the Dynamic Island. The detailed panel (Cmd+Shift+S) shows Activity Monitor-style detailed graphs and metrics.")
|
||||
.multilineTextAlignment(.trailing)
|
||||
.foregroundStyle(.secondary)
|
||||
.font(.caption)
|
||||
} else {
|
||||
Text("When enabled, the Stats tab will display real-time system performance graphs. This feature requires system permissions and may use additional battery.")
|
||||
.multilineTextAlignment(.trailing)
|
||||
.foregroundStyle(.secondary)
|
||||
.font(.caption)
|
||||
}
|
||||
}
|
||||
|
||||
if enableStatsFeature {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue