Compare commits

..

No commits in common. "3f5303a6084251cf4a6610b3081e6eb6eed35193" and "5241d352a63879167982779d1ebae73185fd2c7f" have entirely different histories.

2 changed files with 5 additions and 17 deletions

View File

@ -357,9 +357,9 @@ class AdminSystem {
</div>`;
}
const C = window.LPCharts;
// 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);
// 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);
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. Used on this page's donut, where the per-app
// detail is the point.
// Docker engine categories. Shared by this page's donut and the System
// page's storage summary so both tell the same story.
static unifiedSegments(appStorage, dockerData) {
const pal = SystemStoragePage.APP_PALETTE;
const apps = (appStorage && Array.isArray(appStorage.apps)) ? appStorage.apps : [];
@ -195,18 +195,6 @@ 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.