mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 23:32:12 +03:00
OmniRoute is an intelligent API gateway that unifies 20+ AI providers behind a single OpenAI-compatible endpoint. Features include intelligent routing with 6 strategies, multi-format translation (OpenAI/Claude/Gemini/Responses API), circuit breakers, semantic caching, combo fallback chains, real-time health monitoring, and a full dashboard with provider management, analytics, and CLI tool integration. Key highlights: - 20+ providers (Claude Code, Codex, Gemini CLI, GitHub Copilot, iFlow, Qwen, Kiro, etc.) - 6 routing strategies (Fill First, Round Robin, P2C, Random, Least Used, Cost Optimized) - Export/Import database backup with full archive support - Translator Playground with 4 modes (Playground, Chat Tester, Test Bench, Live Monitor) - 100% TypeScript across src/ and open-sse/ - Docker support with multi-stage builds - Comprehensive documentation and 9 dashboard screenshots
69 lines
1.7 KiB
TypeScript
69 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
import { cn } from "@/shared/utils/cn";
|
|
|
|
const variants = {
|
|
default: "bg-black/5 dark:bg-white/10 text-text-muted",
|
|
primary: "bg-primary/10 text-primary",
|
|
success: "bg-green-500/10 text-green-600 dark:text-green-400",
|
|
warning: "bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",
|
|
error: "bg-red-500/10 text-red-600 dark:text-red-400",
|
|
info: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
|
|
};
|
|
|
|
const sizes = {
|
|
sm: "px-2 py-0.5 text-[10px]",
|
|
md: "px-2.5 py-1 text-xs",
|
|
lg: "px-3 py-1.5 text-sm",
|
|
};
|
|
|
|
interface BadgeProps {
|
|
children?: React.ReactNode;
|
|
variant?: keyof typeof variants;
|
|
size?: keyof typeof sizes;
|
|
dot?: boolean;
|
|
icon?: React.ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
export default function Badge({
|
|
children,
|
|
variant = "default",
|
|
size = "md",
|
|
dot = false,
|
|
icon,
|
|
className,
|
|
}: BadgeProps) {
|
|
return (
|
|
<span
|
|
className={cn(
|
|
"inline-flex items-center gap-1.5 rounded-full font-semibold",
|
|
variants[variant],
|
|
sizes[size],
|
|
className
|
|
)}
|
|
>
|
|
{dot && (
|
|
<span
|
|
aria-hidden="true"
|
|
className={cn(
|
|
"size-1.5 rounded-full",
|
|
variant === "success" && "bg-green-500",
|
|
variant === "warning" && "bg-yellow-500",
|
|
variant === "error" && "bg-red-500",
|
|
variant === "info" && "bg-blue-500",
|
|
variant === "primary" && "bg-primary",
|
|
variant === "default" && "bg-gray-500"
|
|
)}
|
|
/>
|
|
)}
|
|
{icon && (
|
|
<span className="material-symbols-outlined text-[14px]" aria-hidden="true">
|
|
{icon}
|
|
</span>
|
|
)}
|
|
{children}
|
|
</span>
|
|
);
|
|
}
|