diff --git a/ui/litellm-dashboard/src/components/view_logs/columns.tsx b/ui/litellm-dashboard/src/components/view_logs/columns.tsx index 724732ec6a..a4004da2e9 100644 --- a/ui/litellm-dashboard/src/components/view_logs/columns.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/columns.tsx @@ -37,20 +37,29 @@ export const columns: ColumnDef[] = [ id: "expander", header: () => null, cell: ({ row }) => { + const [localExpanded, setLocalExpanded] = React.useState(row.getIsExpanded()); + + // Memoize the toggle handler to prevent unnecessary re-renders + const toggleHandler = React.useCallback(() => { + setLocalExpanded((prev) => !prev); + row.getToggleExpandedHandler()(); + }, [row]); + return row.getCanExpand() ? ( ) : ( - "●" + ); }, }, @@ -93,7 +102,7 @@ export const columns: ColumnDef[] = [ accessorKey: "request_id", cell: (info: any) => ( - + {String(info.getValue() || "")} @@ -114,7 +123,11 @@ export const columns: ColumnDef[] = [ { header: "Team Name", accessorKey: "metadata.user_api_key_team_alias", - cell: (info: any) => {String(info.getValue() || "-")}, + cell: (info: any) => ( + + {String(info.getValue() || "-")} + + ), }, { header: "Key Hash", @@ -123,7 +136,7 @@ export const columns: ColumnDef[] = [ const value = String(info.getValue() || "-"); return ( - {value.slice(0, 5)}... + {value} ); }, @@ -131,7 +144,11 @@ export const columns: ColumnDef[] = [ { header: "Key Name", accessorKey: "metadata.user_api_key_alias", - cell: (info: any) => {String(info.getValue() || "-")}, + cell: (info: any) => ( + + {String(info.getValue() || "-")} + + ), }, { header: "Model", @@ -154,7 +171,7 @@ export const columns: ColumnDef[] = [ /> )} - + {modelName} @@ -181,12 +198,20 @@ export const columns: ColumnDef[] = [ { header: "Internal User", accessorKey: "user", - cell: (info: any) => {String(info.getValue() || "-")}, + cell: (info: any) => ( + + {String(info.getValue() || "-")} + + ), }, { header: "End User", accessorKey: "end_user", - cell: (info: any) => {String(info.getValue() || "-")}, + cell: (info: any) => ( + + {String(info.getValue() || "-")} + + ), }, { diff --git a/ui/litellm-dashboard/src/components/view_logs/index.tsx b/ui/litellm-dashboard/src/components/view_logs/index.tsx index ab38c3fabe..e5df2bbe95 100644 --- a/ui/litellm-dashboard/src/components/view_logs/index.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/index.tsx @@ -637,7 +637,7 @@ function RequestViewer({ row }: { row: Row }) { const hasMessages = row.original.messages && (Array.isArray(row.original.messages) ? row.original.messages.length > 0 : Object.keys(row.original.messages).length > 0); const hasResponse = row.original.response && Object.keys(formatData(row.original.response)).length > 0; - const missingData = !hasMessages || !hasResponse; + const missingData = !hasMessages && !hasResponse; // Format the response with error details if present const formattedResponse = () => {