mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
Adiciona dashboard TUI com 7 abas (Overview, Combos, Providers, Keys, Logs, Health, Cost) via Ink, 13 componentes reutilizáveis em tui-components/, menu interativo ao iniciar sem subcomando, e flag --tui no comando dashboard.
18 lines
602 B
JavaScript
18 lines
602 B
JavaScript
import React from "react";
|
|
import { Text } from "ink";
|
|
|
|
const STATUS_MAP = {
|
|
running: { label: "● running", color: "green" },
|
|
stopped: { label: "● stopped", color: "red" },
|
|
starting: { label: "◌ starting", color: "yellow" },
|
|
error: { label: "✗ error", color: "red" },
|
|
unknown: { label: "? unknown", color: "gray" },
|
|
ok: { label: "✓ ok", color: "green" },
|
|
warn: { label: "⚠ warn", color: "yellow" },
|
|
};
|
|
|
|
export function StatusBadge({ status = "unknown" }) {
|
|
const s = STATUS_MAP[status] ?? { label: status, color: "gray" };
|
|
return <Text color={s.color}>{s.label}</Text>;
|
|
}
|