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 ca75df52946..e3472c16a78 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx @@ -50,12 +50,21 @@ function TraceEventRow({ row, isSelected, onClick }: TraceEventRowProps) { const isMcp = MCP_CALL_TYPES.includes(row.call_type); const isAgent = AGENT_CALL_TYPES.includes(row.call_type); const isRelay = RELAY_CALL_TYPES.includes(row.call_type); - const durationValue = - row.request_duration_ms != null - ? (row.request_duration_ms / 1000).toFixed(3) - : row.startTime && row.endTime - ? ((Date.parse(row.endTime) - Date.parse(row.startTime)) / 1000).toFixed(3) - : "-"; + let durationValue = "-"; + if (row.request_duration_ms != null) { + durationValue = (row.request_duration_ms / 1000).toFixed(3); + } else if (row.startTime && row.endTime) { + durationValue = ((Date.parse(row.endTime) - Date.parse(row.startTime)) / 1000).toFixed(3); + } + + let eventIcon = ; + if (isMcp) { + eventIcon = ; + } else if (isAgent) { + eventIcon = ; + } else if (isRelay) { + eventIcon = ; + } return ( - {isMcp ? ( - - ) : isAgent ? ( - - ) : isRelay ? ( - - ) : ( - - )} + {eventIcon} {getEventDisplayName(row.call_type, row.model)} @@ -277,7 +278,12 @@ export function LogDetailsDrawer({ ).length; const agentCount = sessionLogs.filter((row) => AGENT_CALL_TYPES.includes(row.call_type)).length; const mcpCount = sessionLogs.filter((row) => MCP_CALL_TYPES.includes(row.call_type)).length; - const logsForList = isSessionMode ? sessionLogs : currentLog ? [currentLog] : []; + let logsForList: LogEntry[] = []; + if (isSessionMode) { + logsForList = sessionLogs; + } else if (currentLog) { + logsForList = [currentLog]; + } const leftPanelId = isSessionMode ? sessionId || "" : currentLog?.request_id || ""; const leftPanelDisplayId = leftPanelId.length > 14 ? `${leftPanelId.slice(0, 11)}...` : leftPanelId;