mirror of
https://github.com/ruvnet/RuView
synced 2026-08-09 20:21:43 +00:00
f49c722764
The Rust port lived two directories deep (rust-port/wifi-densepose-rs/) without any sibling under rust-port/ that warranted the extra level. Move the whole workspace up to v2/ to match v1/ (Python) at the same depth and shorten every cd / build command across the repo. git mv preserves history for all tracked files. 60 files updated for path references (CI workflows, ADRs, docs, scripts, READMEs, internal .claude-flow state). Two manual fixes for relative-cd paths in CLAUDE.md and ADR-043 that became wrong after the depth change (cd ../.. → cd ..). Validated: - cargo check --workspace --no-default-features → clean (after target/ nuke; the gitignored target/ was carried by the OS rename and had hard-coded old paths in build scripts) - cargo test --workspace --no-default-features → 1,539 passed, 0 failed, 8 ignored (same totals as pre-rename) - ESP32-S3 on COM7 → still streaming live CSI (cb #40300, RSSI -64 dBm) After-merge follow-up: contributors should `rm -rf v2/target` once and let cargo regenerate from the new path.
60 lines
1.7 KiB
TypeScript
60 lines
1.7 KiB
TypeScript
import type { HealthStatus } from "../types";
|
|
|
|
interface StatusBadgeProps {
|
|
status: HealthStatus;
|
|
size?: "sm" | "md" | "lg";
|
|
}
|
|
|
|
const STATUS_STYLES: Record<HealthStatus, { color: string; label: string }> = {
|
|
online: { color: "var(--status-online)", label: "Online" },
|
|
offline: { color: "var(--status-error)", label: "Offline" },
|
|
degraded: { color: "var(--status-warning)", label: "Degraded" },
|
|
unknown: { color: "var(--text-muted)", label: "Unknown" },
|
|
};
|
|
|
|
const SIZE_STYLES: Record<string, { fontSize: number; padding: string; dot: number }> = {
|
|
sm: { fontSize: 11, padding: "2px 8px", dot: 6 },
|
|
md: { fontSize: 13, padding: "4px 12px", dot: 8 },
|
|
lg: { fontSize: 15, padding: "6px 16px", dot: 10 },
|
|
};
|
|
|
|
export function StatusBadge({ status, size = "sm" }: StatusBadgeProps) {
|
|
const { color, label } = STATUS_STYLES[status];
|
|
const s = SIZE_STYLES[size];
|
|
|
|
return (
|
|
<span
|
|
style={{
|
|
display: "inline-flex",
|
|
alignItems: "center",
|
|
gap: 6,
|
|
color,
|
|
fontSize: s.fontSize,
|
|
fontWeight: 600,
|
|
fontFamily: "var(--font-sans)",
|
|
padding: s.padding,
|
|
borderRadius: 9999,
|
|
lineHeight: 1,
|
|
whiteSpace: "nowrap",
|
|
background: "rgba(255, 255, 255, 0.04)",
|
|
}}
|
|
>
|
|
<span
|
|
style={{
|
|
width: s.dot,
|
|
height: s.dot,
|
|
borderRadius: "50%",
|
|
backgroundColor: color,
|
|
flexShrink: 0,
|
|
boxShadow: status === "online"
|
|
? `0 0 4px ${color}, 0 0 8px ${color}`
|
|
: status === "degraded"
|
|
? `0 0 4px ${color}`
|
|
: "none",
|
|
}}
|
|
/>
|
|
{label}
|
|
</span>
|
|
);
|
|
}
|