feat(frontend): dashboard and stats pages

This commit is contained in:
2026-05-20 21:22:44 +02:00
parent 2444e2400f
commit 289a58fac0
6 changed files with 142 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
export function formatDuration(seconds: number): string {
const h = Math.floor(seconds / 3600);
const m = Math.floor((seconds % 3600) / 60);
const s = seconds % 60;
if (h > 0) return `${h}u ${m}m`;
if (m > 0) return `${m}m ${s}s`;
return `${s}s`;
}
export function formatPct(n: number): string { return `${Math.round(n * 100)}%`; }
export function formatDate(unixSec: number): string {
return new Date(unixSec * 1000).toLocaleString();
}