feat: replace text labels with icons in runtime cards
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user