From 2efb6f344e5eeba9ca640c440398641f1327c634 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 21:18:10 +0000 Subject: [PATCH] feat(ui): add_model/RouterConfigBuilder to shadcn - antd Button/Card/Divider/Flex/Input(TextArea)/Space/Tooltip/ Typography + antd icons \u2192 shadcn Button/Card/Textarea/Tooltip + native flex/grid + lucide Info/Plus/Trash2. - InfoTip helper replaces inline Tooltip+InfoCircle+color styles. - Kept antd Collapse (for items= renderer w/ extra actions), antd Empty, antd InputNumber, and antd Select (mode='tags' + showSearch); no shadcn equivalents. Gates: TS \u2713 | Build \u2713. Co-authored-by: yuneng-jiang --- .../add_model/RouterConfigBuilder.tsx | 153 ++++++++++++------ 1 file changed, 103 insertions(+), 50 deletions(-) diff --git a/ui/litellm-dashboard/src/components/add_model/RouterConfigBuilder.tsx b/ui/litellm-dashboard/src/components/add_model/RouterConfigBuilder.tsx index 9b93287b36d..442211190f3 100644 --- a/ui/litellm-dashboard/src/components/add_model/RouterConfigBuilder.tsx +++ b/ui/litellm-dashboard/src/components/add_model/RouterConfigBuilder.tsx @@ -1,11 +1,27 @@ -import { DeleteOutlined, InfoCircleOutlined, PlusOutlined } from "@ant-design/icons"; -import { Select as AntdSelect, Button, Card, Collapse, Divider, Empty, Flex, Input, InputNumber, Space, Tooltip, Typography } from "antd"; +import { Info, Plus, Trash2 } from "lucide-react"; +import { Select as AntdSelect, Collapse, Empty, InputNumber } from "antd"; +import { Button } from "@/components/ui/button"; +import { Card } from "@/components/ui/card"; +import { Textarea } from "@/components/ui/textarea"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; import React, { useEffect, useState } from "react"; import { ModelGroup } from "../playground/llm_calls/fetch_models"; -const { Text } = Typography; - -const { TextArea } = Input; +const InfoTip: React.FC<{ children: React.ReactNode }> = ({ children }) => ( + + + + + + {children} + + +); interface Route { id: string; @@ -140,55 +156,68 @@ const RouterConfigBuilder: React.FC = ({ modelInfo, va return (
- - - Routes Configuration - - - - - - +
{/* Routes */} {routes.length === 0 ? ( - - + + ) : ( setExpandedRoutes(Array.isArray(keys) ? keys : [keys].filter(Boolean))} + onChange={(keys) => + setExpandedRoutes( + Array.isArray(keys) ? keys : [keys].filter(Boolean), + ) + } style={{ width: "100%" }} items={routes.map((route, index) => ({ key: route.id, label: ( - + Route {index + 1}: {route.model || "Unnamed"} - + ), extra: ( ), children: ( - + {/* Model Selection */}
- Model + + Model + updateRoute(route.id, "model", value)} + onChange={(value) => + updateRoute(route.id, "model", value) + } placeholder="Select model" showSearch style={{ width: "100%" }} @@ -198,27 +227,39 @@ const RouterConfigBuilder: React.FC = ({ modelInfo, va {/* Description */}
- Description -