feat: memory panel sparkline history

This commit is contained in:
Damocles 2026-04-15 21:43:26 +02:00
parent fac3b27679
commit 3582ea2656
2 changed files with 47 additions and 0 deletions

View file

@ -40,6 +40,7 @@ QtObject {
property real memAvailGb: 0
property real memCachedGb: 0
property real memBuffersGb: 0
property var memHistory: []
// Disk
property var diskMounts: []
@ -89,6 +90,8 @@ QtObject {
root.memAvailGb = ev.avail_gb;
root.memCachedGb = ev.cached_gb;
root.memBuffersGb = ev.buffers_gb;
const h = root.memHistory.concat([ev.percent]);
root.memHistory = h.length > 30 ? h.slice(h.length - 30) : h;
}
} catch (e) {}
}