Skip to content

Commit d61015d

Browse files
Fix Dashboard Disk card showing blank value and wrong bar width
The Dashboard template (index.html) calls ramPct() and diskPct() as methods, but dashboardPage() never defined them - Alpine threw a silent ReferenceError on these bindings. This left the Disk card's big percentage value empty, and since the bar's :style binding also failed, the fill defaulted to a near-full width regardless of actual usage (visible as an orange bar that looked ~90% full despite '6.5 GB / 57.1 GB' being ~11%). RAM's big value was unaffected since it reads stats.ram.used directly (fmtBytes), but its bar width had the same issue. Added both methods, computing percentage from stats.{ram,disk}.{used,total} which /api/dashboard/stats already provides.
1 parent e9e941a commit d61015d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

web/static/js/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ function dashboardPage() {
231231
if(r.ok) this.services=r.services.slice(0,8);
232232
},
233233
go(page){ window.dispatchEvent(new CustomEvent('nav',{detail:{page}})); },
234+
ramPct() { const r=this.stats.ram; return (r && r.total) ? Math.round(r.used/r.total*100) : 0; },
235+
diskPct() { const d=this.stats.disk; return (d && d.total) ? Math.round(d.used/d.total*100) : 0; },
234236
};
235237
}
236238

0 commit comments

Comments
 (0)