fix(sv): Backups card byte formatter — tenths for GB, MB under 1G

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-09 17:49:00 +10:00
parent b967c0bfdd
commit b17cdb7f77
4 changed files with 8 additions and 5 deletions

View File

@@ -5,7 +5,10 @@ import { api } from '../../api.js';
let body, timer;
const gb = b => (b == null ? '' : b >= 1e12 ? (b / 1e12).toFixed(1) + 'T' : Math.round(b / 1e9) + 'G');
const gb = b => (b == null ? ''
: b >= 1e12 ? (b / 1e12).toFixed(1) + 'T'
: b >= 1e9 ? (b / 1e9).toFixed(1) + 'G'
: Math.round(b / 1e6) + 'M');
function ago(ts) {
const s = Math.max(0, (Date.now() - Date.parse(ts)) / 1000);
if (s < 3600) return Math.floor(s / 60) + 'm';