diff --git a/ui/litellm-dashboard/.eslintrc.json b/ui/litellm-dashboard/.eslintrc.json index 1251a9e924e..2a0430244ba 100644 --- a/ui/litellm-dashboard/.eslintrc.json +++ b/ui/litellm-dashboard/.eslintrc.json @@ -64,6 +64,7 @@ "src/components/chat/MCPCredentialsTab.tsx", "src/components/common_components/KeyLifecycleSettings.tsx", "src/components/guardrails/GuardrailTestPanel.tsx", + "src/components/guardrails/GuardrailTestResults.tsx", "src/components/prompts/prompt_editor_view/PromptEditorHeader.tsx", "src/components/prompts/prompt_editor_view/VersionHistorySidePanel.tsx", "src/app/(dashboard)/teams/components/TeamsTable/ModelsCell.tsx", diff --git a/ui/litellm-dashboard/src/components/guardrails/GuardrailTestResults.tsx b/ui/litellm-dashboard/src/components/guardrails/GuardrailTestResults.tsx index 25679fd6f14..d28b822569a 100644 --- a/ui/litellm-dashboard/src/components/guardrails/GuardrailTestResults.tsx +++ b/ui/litellm-dashboard/src/components/guardrails/GuardrailTestResults.tsx @@ -1,11 +1,16 @@ import React, { useState } from "react"; -import { Button, Card } from "@tremor/react"; -import { Typography } from "antd"; -import { CopyOutlined, CheckCircleOutlined, ClockCircleOutlined, DownOutlined, RightOutlined } from "@ant-design/icons"; +import { Button } from "@/components/ui/button"; +import { Card } from "@/components/ui/card"; +import { + CheckCircle2, + ChevronDown, + ChevronRight, + Clock, + Copy, + XCircle, +} from "lucide-react"; import NotificationsManager from "../molecules/notifications_manager"; -const { Text } = Typography; - interface TestResult { guardrailName: string; response_text: string; @@ -23,8 +28,13 @@ interface GuardrailTestResultsProps { errors: TestError[] | null; } -export function GuardrailTestResults({ results, errors }: GuardrailTestResultsProps) { - const [collapsedResults, setCollapsedResults] = useState>(new Set()); +export function GuardrailTestResults({ + results, + errors, +}: GuardrailTestResultsProps) { + const [collapsedResults, setCollapsedResults] = useState>( + new Set(), + ); const toggleResultCollapse = (guardrailName: string) => { const newCollapsed = new Set(collapsedResults); @@ -69,50 +79,58 @@ export function GuardrailTestResults({ results, errors }: GuardrailTestResultsPr } return ( -
-

Results

+
+

Results

- {/* Success Results */} {results && results.map((result) => { const isCollapsed = collapsedResults.has(result.guardrailName); return ( - +
-
toggleResultCollapse(result.guardrailName)} > {isCollapsed ? ( - + ) : ( - + )} - - + + {result.guardrailName}
-
- +
+ {result.latency}ms
{!isCollapsed && ( )} @@ -120,16 +138,17 @@ export function GuardrailTestResults({ results, errors }: GuardrailTestResultsPr
{!isCollapsed && ( <> -
-