Compare commits

...

2 Commits

Author SHA1 Message Date
librelad
3f5303a608 Merge claude/2 2026-05-28 23:06:42 +01:00
librelad
d15f6b09ee ux(system): collapse apps into one "Applications" slice on the System summary
The System-page storage ring is an overview, so showing individual app
(compose-project) names was wrong — it now shows a single "Applications"
slice totalling all apps, alongside Images and Build cache. The per-app
breakdown stays on the full Storage page.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-28 23:06:42 +01:00
2 changed files with 17 additions and 5 deletions

View File

@ -357,9 +357,9 @@ class AdminSystem {
</div>`;
}
const C = window.LPCharts;
// Full LibrePortal breakdown: apps + Docker images/cache, not just the
// engine categories — same story the Storage page tells.
const segments = SP.unifiedSegments(this.d.appStorage, s);
// Summary breakdown: one "Applications" total + Docker images/cache. The
// per-app split lives on the full Storage page this links to.
const segments = SP.summarySegments(this.d.appStorage, s);
const grandTotal = segments.reduce((t, seg) => t + ((seg.data && seg.data.size) || 0), 0);
const donut = SP.donutSvg(segments, grandTotal, 'in use');
const recl = s.reclaimable || 0;

View File

@ -185,8 +185,8 @@ class SystemStoragePage {
static get APP_PALETTE() { return ['accent', 'status-info', 'status-success']; }
// The full LibrePortal storage breakdown: a slice per app followed by the
// Docker engine categories. Shared by this page's donut and the System
// page's storage summary so both tell the same story.
// Docker engine categories. Used on this page's donut, where the per-app
// detail is the point.
static unifiedSegments(appStorage, dockerData) {
const pal = SystemStoragePage.APP_PALETTE;
const apps = (appStorage && Array.isArray(appStorage.apps)) ? appStorage.apps : [];
@ -195,6 +195,18 @@ class SystemStoragePage {
return [...appSegs, ...docker];
}
// Summary breakdown for the System-page overview: all apps collapse into one
// "Applications" slice (their total), then the Docker engine categories. The
// per-app split lives on the full Storage page, not here.
static summarySegments(appStorage, dockerData) {
const appsTotal = (appStorage && Number(appStorage.total)) || 0;
const seg = appsTotal > 0
? [{ key: 'apps', label: 'Applications', color: 'accent', data: { size: appsTotal }, kind: 'app' }]
: [];
const docker = dockerData ? SystemStoragePage.segmentsFrom(dockerData).map(s => ({ ...s, kind: 'docker' })) : [];
return [...seg, ...docker];
}
// Hand-rolled donut, full circle = total. Each slice's dashoffset is the
// running cumulative fraction (off), so a slice starts where the previous
// one ended and the ring fills proportionally.