From 331a1fe752b97ffc240b4bb608d24fcc453eb021 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 19:45:59 +0000 Subject: [PATCH] feat(ui): SearchTools/SearchTools to shadcn - @tremor Button/Text/Title + antd Modal/Spin/Input + @ant-design LoadingOutlined \u2192 shadcn Button/Dialog/Input + lucide Loader2 + native headings. - antd Form/Form.Item/Select/AntInput.Password/AntInput.TextArea preserved (form context + rules). antd Table kept. Gates: TS \u2713 | Build \u2713. Co-authored-by: yuneng-jiang --- .../components/SearchTools/SearchTools.tsx | 122 ++++++++++++------ 1 file changed, 85 insertions(+), 37 deletions(-) diff --git a/ui/litellm-dashboard/src/components/SearchTools/SearchTools.tsx b/ui/litellm-dashboard/src/components/SearchTools/SearchTools.tsx index dd2033fc18f..35595eaeb50 100644 --- a/ui/litellm-dashboard/src/components/SearchTools/SearchTools.tsx +++ b/ui/litellm-dashboard/src/components/SearchTools/SearchTools.tsx @@ -1,8 +1,20 @@ import { isAdminRole } from "@/utils/roles"; -import { LoadingOutlined } from "@ant-design/icons"; import { useQuery } from "@tanstack/react-query"; -import { Button, Text, Title } from "@tremor/react"; -import { Form, Input, Modal, Select, Spin, Table } from "antd"; +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; +import { Loader2 } from "lucide-react"; +import { + Form, + Input as AntInput, + Select, + Table, +} from "antd"; import React, { useState } from "react"; import DeleteResourceModal from "../common_components/DeleteResourceModal"; import NotificationsManager from "../molecules/notifications_manager"; @@ -168,7 +180,7 @@ const SearchTools: React.FC = ({ accessToken, userRole, userID label="Search Tool Name" rules={[{ required: true, message: "Please enter a search tool name" }]} > - + = ({ accessToken, userRole, userID - - + + - + ); if (!accessToken || !userRole || !userID) { - console.log("Missing required authentication parameters", { accessToken, userRole, userID }); - return
Missing required authentication parameters.
; + return ( +
+ Missing required authentication parameters. +
+ ); } const ToolsTab = () => @@ -222,21 +244,25 @@ const SearchTools: React.FC = ({ accessToken, userRole, userID availableProviders={availableProviders} /> ) : ( -
- } size="large"> - record.search_tool_id || record.search_tool_name} - pagination={false} - locale={{ - emptyText: "No search tools configured", - }} - size="small" - /> - - +
+ {isLoadingTools && ( +
+ +
+ )} +
+ record.search_tool_id || record.search_tool_name + } + pagination={false} + locale={{ + emptyText: "No search tools configured", + }} + size="small" + /> ); @@ -274,24 +300,46 @@ const SearchTools: React.FC = ({ accessToken, userRole, userID /> {/* Edit Modal */} - { - setEditModalVisible(false); - form.resetFields(); - setSelectedToolId(null); + onOpenChange={(o) => { + if (!o) { + setEditModalVisible(false); + form.resetFields(); + setSelectedToolId(null); + } }} - width={600} > - {renderEditForm()} - + + + Edit Search Tool + + {renderEditForm()} + + + + + + - Search Tools - Configure and manage your search providers +

Search Tools

+

+ Configure and manage your search providers +

{isAdminRole(userRole) && ( - )}