diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/DrawerHeader.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/DrawerHeader.tsx index 6b3f7fdaa5b..25fcdf953e9 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/DrawerHeader.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/DrawerHeader.tsx @@ -1,5 +1,5 @@ -import { Button, Tag, Tooltip, Typography } from "antd"; -import { CloseOutlined, CopyOutlined, UpOutlined, DownOutlined } from "@ant-design/icons"; +import { Button, Space, Tag, Tooltip, Typography } from "antd"; +import { CloseOutlined, UpOutlined, DownOutlined } from "@ant-design/icons"; import moment from "moment"; import { LogEntry } from "../columns"; import { getProviderLogoAndName } from "../../provider_info_helpers"; @@ -20,7 +20,6 @@ const { Text } = Typography; interface DrawerHeaderProps { log: LogEntry; onClose: () => void; - onCopyRequestId: () => void; onPrevious: () => void; onNext: () => void; statusLabel: string; @@ -35,7 +34,6 @@ interface DrawerHeaderProps { export function DrawerHeader({ log, onClose, - onCopyRequestId, onPrevious, onNext, statusLabel, @@ -61,7 +59,7 @@ export function DrawerHeader({ {/* Row 1: Request ID + Actions */}
;
);
}
-// ============================================================================
-// Helper Functions
-// ============================================================================
-
-function formatData(input: any) {
- if (typeof input === "string") {
- try {
- return JSON.parse(input);
- } catch {
- return input;
- }
- }
- return input;
-}
-
-function checkHasMessages(messages: any): boolean {
- if (!messages) return false;
- if (Array.isArray(messages)) return messages.length > 0;
- if (typeof messages === "object") return Object.keys(messages).length > 0;
- return false;
-}
-
-function checkHasResponse(response: any): boolean {
- if (!response) return false;
- return Object.keys(formatData(response)).length > 0;
-}
-
-function normalizeGuardrailEntries(guardrailInfo: any): any[] {
- if (Array.isArray(guardrailInfo)) return guardrailInfo;
- if (guardrailInfo) return [guardrailInfo];
- return [];
-}
-
-function calculateTotalMaskedEntities(entries: any[]): number {
- return entries.reduce((sum, entry) => {
- const maskedCounts = entry?.masked_entity_count;
- if (!maskedCounts) return sum;
- return (
- sum +
- Object.values(maskedCounts).reduce((acc, count) => (typeof count === "number" ? acc + count : acc), 0)
- );
- }, 0);
-}
-
-function getGuardrailLabel(entries: any[]): string {
- if (entries.length === 0) return "-";
- if (entries.length === 1) return entries[0]?.guardrail_name ?? "-";
- return `${entries.length} guardrails`;
-}
-
-function checkHasVectorStoreData(metadata: Record): boolean {
- return (
- metadata.vector_store_request_metadata &&
- Array.isArray(metadata.vector_store_request_metadata) &&
- metadata.vector_store_request_metadata.length > 0
- );
-}