From 2d2b502b9db2a700651492d5ba9a2537abc33c43 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Fri, 30 Jan 2026 16:35:06 -0800 Subject: [PATCH] ui fixes --- .../view_logs/CostBreakdownViewer.tsx | 36 ++-- .../GuardrailViewer/GuardrailViewer.tsx | 91 +++++---- .../LogDetailsDrawer/LogDetailsDrawer.tsx | 172 +++++++++--------- .../view_logs/ToolsSection/ToolsSection.tsx | 1 + .../view_logs/VectorStoreViewer.tsx | 37 ++-- 5 files changed, 169 insertions(+), 168 deletions(-) diff --git a/ui/litellm-dashboard/src/components/view_logs/CostBreakdownViewer.tsx b/ui/litellm-dashboard/src/components/view_logs/CostBreakdownViewer.tsx index 7a02b89891b..01cbd74c5a8 100644 --- a/ui/litellm-dashboard/src/components/view_logs/CostBreakdownViewer.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/CostBreakdownViewer.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Accordion, AccordionHeader, AccordionBody } from "@tremor/react"; +import { Collapse } from "antd"; import { formatNumberWithCommas } from "@/utils/dataUtils"; export interface CostBreakdown { @@ -60,18 +60,22 @@ export const CostBreakdownViewer: React.FC = ({ return (
- - -
-

Cost Breakdown

-
- Total: - {formatCost(totalSpend)} -
-
-
- -
+ +

Cost Breakdown

+
+ Total: + {formatCost(totalSpend)} +
+
+ ), + children: ( +
{/* Step 1: Base Token Costs */}
@@ -149,8 +153,10 @@ export const CostBreakdownViewer: React.FC = ({
-
-
+ ), + }, + ]} + />
); }; diff --git a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx b/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx index b25545200cd..206418fb314 100644 --- a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import { Tooltip } from "antd"; +import { Tooltip, Collapse } from "antd"; import PresidioDetectedEntities from "./PresidioDetectedEntities"; import BedrockGuardrailDetails, { BedrockGuardrailResponse, @@ -207,8 +207,6 @@ const GuardrailViewer = ({ data }: GuardrailViewerProps) => { ? [data] : []; - const [sectionExpanded, setSectionExpanded] = useState(true); - const primaryName = guardrailEntries.length === 1 ? guardrailEntries[0].guardrail_name : `${guardrailEntries.length} guardrails`; const statuses = Array.from(new Set(guardrailEntries.map((entry) => entry.guardrail_status))); @@ -231,55 +229,50 @@ const GuardrailViewer = ({ data }: GuardrailViewerProps) => { } return ( -
-
setSectionExpanded(!sectionExpanded)} - > -
- - - -

Guardrail Information

+
+ +

Guardrail Information

- - - {aggregatedStatus} - - + + + {aggregatedStatus} + + - {primaryName} + {primaryName} - {totalMaskedEntities > 0 && ( - - {totalMaskedEntities} masked {totalMaskedEntities === 1 ? "entity" : "entities"} - - )} -
- {sectionExpanded ? "Click to collapse" : "Click to expand"} -
- - {sectionExpanded && ( -
- {guardrailEntries.map((entry, index) => ( - - ))} -
- )} + {totalMaskedEntities > 0 && ( + + {totalMaskedEntities} masked {totalMaskedEntities === 1 ? "entity" : "entities"} + + )} +
+ ), + children: ( +
+ {guardrailEntries.map((entry, index) => ( + + ))} +
+ ), + }, + ]} + />
); }; diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx index cb7f2e2558e..c88bf069965 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx @@ -1,7 +1,6 @@ import { useState } from "react"; -import { Drawer, Typography, Button, Descriptions, Card, Tag, Tabs, Alert, message } from "antd"; +import { Drawer, Typography, Button, Descriptions, Card, Tag, Tabs, Alert, message, Collapse } from "antd"; import { CopyOutlined } from "@ant-design/icons"; -import { Accordion, AccordionHeader, AccordionBody } from "@tremor/react"; import moment from "moment"; import { LogEntry } from "../columns"; import { formatNumberWithCommas } from "@/utils/dataUtils"; @@ -359,56 +358,61 @@ function RequestResponseSection({ return (
- - -

Request & Response

-
- -
- setActiveTab(key as typeof TAB_REQUEST | typeof TAB_RESPONSE)} - tabBarExtraContent={ - - } - items={[ - { - key: TAB_REQUEST, - label: "Request", - children: ( -
- -
- ), - }, - { - key: TAB_RESPONSE, - label: "Response", - children: ( -
- {hasResponse ? ( - - ) : ( -
- Response data not available + Request & Response, + children: ( +
+ setActiveTab(key as typeof TAB_REQUEST | typeof TAB_RESPONSE)} + tabBarExtraContent={ + + } + items={[ + { + key: TAB_REQUEST, + label: "Request", + children: ( +
+
- )} -
- ), - }, - ]} - /> -
- - + ), + }, + { + key: TAB_RESPONSE, + label: "Response", + children: ( +
+ {hasResponse ? ( + + ) : ( +
+ Response data not available +
+ )} +
+ ), + }, + ]} + /> +
+ ), + }, + ]} + />
); } @@ -416,36 +420,42 @@ function RequestResponseSection({ function MetadataSection({ metadata, onCopy }: { metadata: Record; onCopy: (data: string) => void }) { return (
- } - onClick={() => onCopy(JSON.stringify(metadata, null, 2))} - > - Copy - - } - > -
-          {JSON.stringify(metadata, null, 2)}
-        
-
+ Metadata, + children: ( +
+
+ +
+
+                  {JSON.stringify(metadata, null, 2)}
+                
+
+ ), + }, + ]} + />
); } diff --git a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolsSection.tsx b/ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolsSection.tsx index 60bcce214af..7152db05599 100644 --- a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolsSection.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolsSection.tsx @@ -34,6 +34,7 @@ export function ToolsSection({ log }: ToolsSectionProps) { return (
>({}); if (!data || data.length === 0) { @@ -56,27 +56,15 @@ export function VectorStoreViewer({ data }: VectorStoreViewerProps) { }; return ( -
-
setSectionExpanded(!sectionExpanded)} - > -
- - - -

Vector Store Requests

-
- {sectionExpanded ? "Click to collapse" : "Click to expand"} -
- - {sectionExpanded && ( -
+
+ Vector Store Requests, + children: ( +
{data.map((request, index) => (
@@ -168,7 +156,10 @@ export function VectorStoreViewer({ data }: VectorStoreViewerProps) {
))}
- )} + ), + }, + ]} + />
); }