Compare commits
No commits in common. "9324c6a4f489d01c405c55f8b03320ae62cc10e9" and "f792cf55f63d6036461a585d6a78041cbd96b9f0" have entirely different histories.
9324c6a4f4
...
f792cf55f6
@ -149,10 +149,9 @@ class AdminOverview {
|
|||||||
'System',
|
'System',
|
||||||
sysKind,
|
sysKind,
|
||||||
this.line('Disk', disk.text || `${diskPct}%`)
|
this.line('Disk', disk.text || `${diskPct}%`)
|
||||||
+ this.line('Memory', mem.total
|
+ this.line('Memory', mem.text || '—')
|
||||||
? `${this.gb(mem.used)} / ${this.gb(mem.total)} (${Math.round(mem.percent) || 0}%)`
|
+ this.line('Uptime', (info.uptime || '—').replace(/^up /, ''))
|
||||||
: (mem.text || '—'))
|
+ this.line('OS', info.os || '—'),
|
||||||
+ this.line('Uptime', this.shortUptime(info.uptime)),
|
|
||||||
`<button type="button" class="backup-secondary-btn" data-admin-go="system">View system stats →</button>`
|
`<button type="button" class="backup-secondary-btn" data-admin-go="system">View system stats →</button>`
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -181,22 +180,6 @@ class AdminOverview {
|
|||||||
while (n >= 1024 && i < u.length - 1) { n /= 1024; i++; }
|
while (n >= 1024 && i < u.length - 1) { n /= 1024; i++; }
|
||||||
return `${n.toFixed(i ? 1 : 0)} ${u[i]}`;
|
return `${n.toFixed(i ? 1 : 0)} ${u[i]}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compact gigabytes, e.g. 2030043136 → "1.9G", matching the Disk row's style.
|
|
||||||
gb(n) {
|
|
||||||
return `${((parseInt(n) || 0) / 1073741824).toFixed(1)}G`;
|
|
||||||
}
|
|
||||||
|
|
||||||
// "up 1 hour, 11 minutes" → "1h 11m".
|
|
||||||
shortUptime(u) {
|
|
||||||
return (u || '—')
|
|
||||||
.replace(/^up\s+/, '')
|
|
||||||
.replace(/\s*weeks?/g, 'w')
|
|
||||||
.replace(/\s*days?/g, 'd')
|
|
||||||
.replace(/\s*hours?/g, 'h')
|
|
||||||
.replace(/\s*minutes?/g, 'm')
|
|
||||||
.replace(/,/g, '');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.AdminOverview = AdminOverview;
|
window.AdminOverview = AdminOverview;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user