feat(webui,dashboard): add RAM Usage card between Disk Usage and Uptime, live-verified on Pager

This commit is contained in:
c4ch3c4d3
2026-08-24 18:12:32 -06:00
parent e683691a53
commit 18bd6e3f9a
3 changed files with 37 additions and 2 deletions
@@ -192,7 +192,7 @@ views.dashboard = (root) => {
root.appendChild(grid);
const defs = [
['clients', 'Clients Connected'], ['handshakes', 'Handshakes Captured'],
['disk', 'Disk Usage'], ['uptime', 'Uptime']
['disk', 'Disk Usage'], ['mem', 'RAM Usage'], ['uptime', 'Uptime']
];
const cards = {};
defs.forEach(([k, label]) => {
@@ -318,6 +318,8 @@ views.dashboard = (root) => {
cards.uptime.textContent = s.uptime == null ? 'Unavailable' : fmtDur(s.uptime);
cards.disk.textContent = s.disk && s.disk.size != null
? fmtBytes(s.disk.used) + ' / ' + fmtBytes(s.disk.size) : 'Unavailable';
cards.mem.textContent = s.mem && s.mem.size != null
? fmtBytes(s.mem.used) + ' / ' + fmtBytes(s.mem.size) : 'Unavailable';
if (typeof MiniChart !== 'undefined') {
MiniChart.draw(canvas, [
{ label: 'Clients', color: '#1976d2', points: history.clients }
@@ -329,6 +331,7 @@ views.dashboard = (root) => {
.catch(() => {
cards.clients.textContent = '0';
cards.disk.textContent = '—';
cards.mem.textContent = '—';
cards.uptime.textContent = '—';
});
PagerAPI.get('/api/pineap/handshakes').then((r) => {