feat: replace text labels with icons in runtime cards
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m20s
CI / docker (push) Successful in 1m38s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 53s

Use Activity, Cpu, and HeartPulse icons instead of "tps", "cpu", and
"ago" text in compact and expanded app cards. Bump design-system to
v0.1.55 for sidebar footer alignment fix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-16 15:43:37 +02:00
parent 11ad769f59
commit a1ea112876
5 changed files with 37 additions and 40 deletions

View File

@@ -24,16 +24,17 @@ export function statusLabel(s: string): string {
return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
}
export function timeAgo(iso?: string): string {
export function timeAgo(iso?: string, short = false): string {
if (!iso) return '\u2014';
const diff = Date.now() - new Date(iso).getTime();
const secs = Math.floor(diff / 1000);
if (secs < 60) return `${secs}s ago`;
const suffix = short ? '' : ' ago';
if (secs < 60) return `${secs}s${suffix}`;
const mins = Math.floor(secs / 60);
if (mins < 60) return `${mins}m ago`;
if (mins < 60) return `${mins}m${suffix}`;
const hours = Math.floor(mins / 60);
if (hours < 24) return `${hours}h ago`;
return `${Math.floor(hours / 24)}d ago`;
if (hours < 24) return `${hours}h${suffix}`;
return `${Math.floor(hours / 24)}d${suffix}`;
}
export function formatMetric(value: number, unit: string, decimals = 1): string {