Compare commits
2 Commits
5241d352a6
...
3f5303a608
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f5303a608 | ||
|
|
d15f6b09ee |
@ -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;
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user