From 1459e004300c6f7d356add1870df329745673cc4 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 4 Oct 2026 10:00:49 -0700 Subject: [PATCH] refactor(ui): rename view_logs to logs and split request, audit and detail (#44505) Co-authored-by: Yujong Lee Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/unit/proxy/auth/test_route_checks.py | 4 ++-- ui/litellm-dashboard/eslint-suppressions.json | 18 +++++++++--------- .../_components/PromptCachingRequestsTable.tsx | 2 +- .../(dashboard)/logs/page.integration.test.tsx | 2 +- .../src/app/(dashboard)/logs/page.test.tsx | 4 ++-- .../src/app/(dashboard)/logs/page.tsx | 4 ++-- .../GuardrailsMonitor/LogViewer.test.tsx | 4 ++-- .../components/GuardrailsMonitor/LogViewer.tsx | 4 ++-- .../add_model/AutoRouterRoutingTest.tsx | 2 +- .../common_components/simple_table.tsx | 2 +- .../lens/traces/detail/RequestDetail.tsx | 2 +- .../lens/traces/detail/useSpanRequestLog.ts | 2 +- .../AuditLogDrawer/AuditLogDrawer.test.tsx | 2 +- .../audit}/AuditLogDrawer/AuditLogDrawer.tsx | 2 +- .../audit}/AuditLogsPanel.test.tsx | 8 ++++---- .../audit}/AuditLogsPanel.tsx | 2 +- .../audit}/AuditLogsTable.test.tsx | 0 .../audit}/AuditLogsTable.tsx | 0 .../audit}/AuditLogsTableColumns.tsx | 2 +- .../{view_logs => logs}/batchLogUtils.test.ts | 0 .../{view_logs => logs}/batchLogUtils.ts | 0 .../{view_logs => logs}/constants.ts | 0 .../detail}/ClassifierAuditView.test.tsx | 0 .../detail}/ClassifierAuditView.tsx | 0 .../detail}/ClassifyTag.test.tsx | 0 .../detail}/ClassifyTag.tsx | 0 .../detail}/CollapsibleMessage.test.tsx | 0 .../detail}/CollapsibleMessage.tsx | 0 .../detail}/DrawerHeader.test.tsx | 2 +- .../detail}/DrawerHeader.tsx | 2 +- .../detail}/HistoryTree.test.tsx | 0 .../detail}/HistoryTree.tsx | 0 .../detail}/InputCard.test.tsx | 0 .../detail}/InputCard.tsx | 0 .../detail}/JsonViewer.test.tsx | 0 .../detail}/JsonViewer.tsx | 0 .../LogDetailContent.integration.test.tsx | 4 ++-- .../detail}/LogDetailContent.tsx | 14 +++++++------- .../detail}/LogDetailsDrawer.test.tsx | 2 +- .../detail}/LogDetailsDrawer.tsx | 4 ++-- .../detail}/OutputCard.test.tsx | 0 .../detail}/OutputCard.tsx | 0 .../detail}/PrettyMessagesView.test.tsx | 0 .../detail}/PrettyMessagesView.tsx | 0 .../detail}/RealtimePrettyView.test.tsx | 0 .../detail}/RealtimePrettyView.tsx | 0 .../detail}/RoutingDecisionCard.test.tsx | 0 .../detail}/RoutingDecisionCard.tsx | 0 .../detail}/SectionHeader.test.tsx | 0 .../detail}/SectionHeader.tsx | 0 .../detail}/SidebarToggle.tsx | 0 .../detail}/SimpleMessageBlock.test.tsx | 0 .../detail}/SimpleMessageBlock.tsx | 0 .../detail}/SimpleToolCallBlock.test.tsx | 0 .../detail}/SimpleToolCallBlock.tsx | 0 .../detail}/TokenFlow.test.tsx | 0 .../detail}/TokenFlow.tsx | 0 .../detail}/TruncatedValue.test.tsx | 0 .../detail}/TruncatedValue.tsx | 0 .../detail}/constants.ts | 0 .../detail/eventDisplayName.ts} | 2 +- .../LogDetailsDrawer => logs/detail}/index.ts | 0 .../detail}/prettyMessagesTypes.ts | 0 .../detail}/prettyMessagesUtils.ts | 0 .../sections}/ConfigInfoMessage.test.tsx | 0 .../detail/sections}/ConfigInfoMessage.tsx | 0 .../sections}/CostBreakdownViewer.test.tsx | 2 +- .../detail/sections}/CostBreakdownViewer.tsx | 0 .../detail/sections}/EvalViewer/EvalViewer.tsx | 0 .../BedrockGuardrailDetails.test.tsx | 6 +++--- .../BedrockGuardrailDetails.tsx | 0 .../GuardrailViewer/CompliancePanel.tsx | 0 .../GuardrailViewer/ContentFilterDetails.tsx | 0 .../GuardrailViewer/GuardrailViewer.test.tsx | 16 ++++++++-------- .../GuardrailViewer/GuardrailViewer.tsx | 2 +- .../PresidioDetectedEntities.test.tsx | 6 +++--- .../PresidioDetectedEntities.tsx | 0 .../GuardrailViewer/__tests__/fixtures.ts | 2 +- .../ToolsSection/FormattedToolView.tsx | 0 .../sections}/ToolsSection/JsonToolView.tsx | 0 .../ToolsSection/ToolExpandedContent.tsx | 0 .../detail/sections}/ToolsSection/ToolItem.tsx | 0 .../ToolsSection/ToolsSection.test.tsx | 2 +- .../sections}/ToolsSection/ToolsSection.tsx | 2 +- .../detail/sections}/ToolsSection/index.ts | 0 .../detail/sections}/ToolsSection/types.ts | 0 .../sections}/ToolsSection/utils.test.ts | 2 +- .../detail/sections}/ToolsSection/utils.ts | 2 +- .../detail/sections}/VectorStoreViewer.tsx | 2 +- .../detail}/useKeyboardNavigation.test.tsx | 2 +- .../detail}/useKeyboardNavigation.ts | 2 +- .../detail}/utils.test.ts | 0 .../LogDetailsDrawer => logs/detail}/utils.ts | 0 .../request}/LogsTableToolbar.tsx | 4 ++-- .../request}/RequestLogsFilters.test.tsx | 6 +++--- .../request}/RequestLogsFilters.tsx | 6 +++--- .../request}/RequestLogsPanel.test.tsx | 12 ++++++------ .../request}/RequestLogsPanel.tsx | 12 ++++++------ .../request}/RequestLogsTable.tsx | 8 ++++---- .../request}/RequestLogsTableColumns.test.tsx | 2 +- .../request}/RequestLogsTableColumns.tsx | 8 ++++---- .../request}/TypeBadges.test.tsx | 0 .../{view_logs => logs/request}/TypeBadges.tsx | 0 .../request}/logDetailRouting.ts | 0 .../request/timeRange.test.ts} | 2 +- .../request/timeRange.ts} | 0 .../request/useLogFilterLogic.test.tsx} | 8 ++++---- .../request/useLogFilterLogic.ts} | 12 ++++++------ .../{view_logs/columns.tsx => logs/types.ts} | 0 .../src/components/networking.tsx | 2 +- .../tests/CreateKeyPage.expiredToken.test.tsx | 2 +- 111 files changed, 114 insertions(+), 114 deletions(-) rename ui/litellm-dashboard/src/components/{view_logs => logs/audit}/AuditLogDrawer/AuditLogDrawer.test.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs => logs/audit}/AuditLogDrawer/AuditLogDrawer.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs => logs/audit}/AuditLogsPanel.test.tsx (95%) rename ui/litellm-dashboard/src/components/{view_logs => logs/audit}/AuditLogsPanel.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs => logs/audit}/AuditLogsTable.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/audit}/AuditLogsTable.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/audit}/AuditLogsTableColumns.tsx (97%) rename ui/litellm-dashboard/src/components/{view_logs => logs}/batchLogUtils.test.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs}/batchLogUtils.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs}/constants.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/ClassifierAuditView.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/ClassifierAuditView.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/ClassifyTag.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/ClassifyTag.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/CollapsibleMessage.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/CollapsibleMessage.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/DrawerHeader.test.tsx (98%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/DrawerHeader.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/HistoryTree.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/HistoryTree.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/InputCard.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/InputCard.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/JsonViewer.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/JsonViewer.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/LogDetailContent.integration.test.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/LogDetailContent.tsx (98%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/LogDetailsDrawer.test.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/LogDetailsDrawer.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/OutputCard.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/OutputCard.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/PrettyMessagesView.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/PrettyMessagesView.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/RealtimePrettyView.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/RealtimePrettyView.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/RoutingDecisionCard.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/RoutingDecisionCard.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/SectionHeader.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/SectionHeader.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/SidebarToggle.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/SimpleMessageBlock.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/SimpleMessageBlock.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/SimpleToolCallBlock.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/SimpleToolCallBlock.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/TokenFlow.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/TokenFlow.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/TruncatedValue.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/TruncatedValue.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/constants.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs/utils.ts => logs/detail/eventDisplayName.ts} (93%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/index.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/prettyMessagesTypes.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/prettyMessagesUtils.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ConfigInfoMessage.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ConfigInfoMessage.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/CostBreakdownViewer.test.tsx (98%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/CostBreakdownViewer.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/EvalViewer/EvalViewer.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/GuardrailViewer/BedrockGuardrailDetails.test.tsx (95%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/GuardrailViewer/BedrockGuardrailDetails.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/GuardrailViewer/CompliancePanel.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/GuardrailViewer/ContentFilterDetails.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/GuardrailViewer/GuardrailViewer.test.tsx (95%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/GuardrailViewer/GuardrailViewer.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/GuardrailViewer/PresidioDetectedEntities.test.tsx (87%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/GuardrailViewer/PresidioDetectedEntities.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/GuardrailViewer/__tests__/fixtures.ts (97%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ToolsSection/FormattedToolView.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ToolsSection/JsonToolView.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ToolsSection/ToolExpandedContent.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ToolsSection/ToolItem.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ToolsSection/ToolsSection.test.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ToolsSection/ToolsSection.tsx (98%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ToolsSection/index.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ToolsSection/types.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ToolsSection/utils.test.ts (99%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/ToolsSection/utils.ts (99%) rename ui/litellm-dashboard/src/components/{view_logs => logs/detail/sections}/VectorStoreViewer.tsx (98%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/useKeyboardNavigation.test.tsx (95%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/useKeyboardNavigation.ts (96%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/utils.test.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs/LogDetailsDrawer => logs/detail}/utils.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/request}/LogsTableToolbar.tsx (97%) rename ui/litellm-dashboard/src/components/{view_logs => logs/request}/RequestLogsFilters.test.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs => logs/request}/RequestLogsFilters.tsx (98%) rename ui/litellm-dashboard/src/components/{view_logs => logs/request}/RequestLogsPanel.test.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs => logs/request}/RequestLogsPanel.tsx (97%) rename ui/litellm-dashboard/src/components/{view_logs => logs/request}/RequestLogsTable.tsx (96%) rename ui/litellm-dashboard/src/components/{view_logs => logs/request}/RequestLogsTableColumns.test.tsx (99%) rename ui/litellm-dashboard/src/components/{view_logs => logs/request}/RequestLogsTableColumns.tsx (98%) rename ui/litellm-dashboard/src/components/{view_logs => logs/request}/TypeBadges.test.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/request}/TypeBadges.tsx (100%) rename ui/litellm-dashboard/src/components/{view_logs => logs/request}/logDetailRouting.ts (100%) rename ui/litellm-dashboard/src/components/{view_logs/logs_utils.test.tsx => logs/request/timeRange.test.ts} (97%) rename ui/litellm-dashboard/src/components/{view_logs/logs_utils.tsx => logs/request/timeRange.ts} (100%) rename ui/litellm-dashboard/src/components/{view_logs/log_filter_logic.test.tsx => logs/request/useLogFilterLogic.test.tsx} (98%) rename ui/litellm-dashboard/src/components/{view_logs/log_filter_logic.tsx => logs/request/useLogFilterLogic.ts} (96%) rename ui/litellm-dashboard/src/components/{view_logs/columns.tsx => logs/types.ts} (100%) diff --git a/tests/unit/proxy/auth/test_route_checks.py b/tests/unit/proxy/auth/test_route_checks.py index 6b1d8bc3a2c..d0d52dd6566 100644 --- a/tests/unit/proxy/auth/test_route_checks.py +++ b/tests/unit/proxy/auth/test_route_checks.py @@ -2218,9 +2218,9 @@ def test_proxy_admin_viewer_can_access_audit_logs(route): # layer, even though the underlying handlers already gate on PROXY_ADMIN_VIEW_ONLY. # # Each route below corresponds to a network call made by the Logs page -# (ui/litellm-dashboard/src/components/view_logs/) — see the comment on each. +# (ui/litellm-dashboard/src/components/logs/) — see the comment on each. ADMIN_VIEWER_LOGS_PAGE_ROUTES = [ - # Main paginated log list — uiSpendLogsCall in log_filter_logic.tsx & index.tsx + # Main paginated log list — uiSpendLogsCall in request/useLogFilterLogic.ts & index.tsx "/spend/logs/ui", # Single-log detail drawer — fetched on row click in LogDetailsDrawer "/spend/logs/ui/abc-request-id", diff --git a/ui/litellm-dashboard/eslint-suppressions.json b/ui/litellm-dashboard/eslint-suppressions.json index 61ab85d613a..74672cf950e 100644 --- a/ui/litellm-dashboard/eslint-suppressions.json +++ b/ui/litellm-dashboard/eslint-suppressions.json @@ -2266,12 +2266,12 @@ "count": 1 } }, - "src/components/view_logs/EvalViewer/EvalViewer.tsx": { + "src/components/logs/detail/sections/EvalViewer/EvalViewer.tsx": { "no-nested-ternary": { "count": 1 } }, - "src/components/view_logs/GuardrailViewer/CompliancePanel.tsx": { + "src/components/logs/detail/sections/GuardrailViewer/CompliancePanel.tsx": { "no-nested-ternary": { "count": 2 }, @@ -2279,17 +2279,17 @@ "count": 1 } }, - "src/components/view_logs/GuardrailViewer/ContentFilterDetails.tsx": { + "src/components/logs/detail/sections/GuardrailViewer/ContentFilterDetails.tsx": { "no-nested-ternary": { "count": 1 } }, - "src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx": { + "src/components/logs/detail/sections/GuardrailViewer/GuardrailViewer.tsx": { "no-nested-ternary": { "count": 3 } }, - "src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx": { + "src/components/logs/detail/LogDetailsDrawer.tsx": { "no-nested-ternary": { "count": 2 }, @@ -2297,22 +2297,22 @@ "count": 2 } }, - "src/components/view_logs/LogDetailsDrawer/useKeyboardNavigation.ts": { + "src/components/logs/detail/useKeyboardNavigation.ts": { "react-hooks/immutability": { "count": 2 } }, - "src/components/view_logs/columns.tsx": { + "src/components/logs/types.ts": { "local/filename-pascal-case": { "count": 1 } }, - "src/components/view_logs/log_filter_logic.tsx": { + "src/components/logs/request/useLogFilterLogic.ts": { "local/filename-pascal-case": { "count": 1 } }, - "src/components/view_logs/logs_utils.tsx": { + "src/components/logs/request/timeRange.ts": { "local/filename-pascal-case": { "count": 1 } diff --git a/ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/PromptCachingRequestsTable.tsx b/ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/PromptCachingRequestsTable.tsx index ba9cfd8ca22..c6900a3b2ab 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/PromptCachingRequestsTable.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/PromptCachingRequestsTable.tsx @@ -11,7 +11,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { LOG_ID_QUERY_PARAM } from "@/components/view_logs/logDetailRouting"; +import { LOG_ID_QUERY_PARAM } from "@/components/logs/request/logDetailRouting"; import type { paths } from "@/lib/http/schema"; import { formatNumberWithCommas } from "@/utils/dataUtils"; import { uiHref } from "@/utils/uiHref"; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/logs/page.integration.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/logs/page.integration.test.tsx index dc8a57e50ba..c463a04bf05 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/logs/page.integration.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/logs/page.integration.test.tsx @@ -17,7 +17,7 @@ vi.mock("@/app/(dashboard)/hooks/organizations/useOrganizations", () => ({ useOrganizations: useOrganizationsMock, })); -vi.mock("@/components/view_logs/RequestLogsPanel", () => ({ +vi.mock("@/components/logs/request/RequestLogsPanel", () => ({ default: function RequestLogsPanelMock() { return
; }, diff --git a/ui/litellm-dashboard/src/app/(dashboard)/logs/page.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/logs/page.test.tsx index c7e0a82a363..0e86e8bb9d2 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/logs/page.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/logs/page.test.tsx @@ -17,13 +17,13 @@ vi.mock("@/app/(dashboard)/hooks/organizations/useOrganizations", () => ({ useOrganizations: useOrganizationsMock, })); -vi.mock("@/components/view_logs/RequestLogsPanel", () => ({ +vi.mock("@/components/logs/request/RequestLogsPanel", () => ({ default: function RequestLogsPanelMock({ isActive }: { isActive: boolean }) { return
{isActive ? "active" : "inactive"}
; }, })); -vi.mock("@/components/view_logs/AuditLogsPanel", () => ({ +vi.mock("@/components/logs/audit/AuditLogsPanel", () => ({ default: function AuditLogsPanelMock({ isActive }: { isActive: boolean }) { return
{isActive ? "active" : "inactive"}
; }, diff --git a/ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx index 51603dec29e..a9672b088ba 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx @@ -5,8 +5,8 @@ import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; import useCan from "@/app/(dashboard)/hooks/useCan"; import DeletedKeysPage from "@/components/DeletedKeysPage/DeletedKeysPage"; import DeletedTeamsPage from "@/components/DeletedTeamsPage/DeletedTeamsPage"; -import AuditLogsPanel from "@/components/view_logs/AuditLogsPanel"; -import RequestLogsPanel from "@/components/view_logs/RequestLogsPanel"; +import AuditLogsPanel from "@/components/logs/audit/AuditLogsPanel"; +import RequestLogsPanel from "@/components/logs/request/RequestLogsPanel"; import { Page, PageTabs, PageTabsList, PageTabsTrigger, PageTabsContent } from "@/components/shared/Page"; import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner"; diff --git a/ui/litellm-dashboard/src/components/GuardrailsMonitor/LogViewer.test.tsx b/ui/litellm-dashboard/src/components/GuardrailsMonitor/LogViewer.test.tsx index 083b1e5f3e2..c1fb0431e8e 100644 --- a/ui/litellm-dashboard/src/components/GuardrailsMonitor/LogViewer.test.tsx +++ b/ui/litellm-dashboard/src/components/GuardrailsMonitor/LogViewer.test.tsx @@ -3,7 +3,7 @@ import React from "react"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { renderWithProviders, screen, testQueryClient, waitFor, within } from "../../../tests/test-utils"; -import type { LogEntry as SpendLogEntry } from "@/components/view_logs/columns"; +import type { LogEntry as SpendLogEntry } from "@/components/logs/types"; import { LogViewer } from "./LogViewer"; vi.mock("@/components/networking", async (importOriginal) => { @@ -11,7 +11,7 @@ vi.mock("@/components/networking", async (importOriginal) => { return { ...actual, uiSpendLogsCall: vi.fn() }; }); -vi.mock("@/components/view_logs/LogDetailsDrawer", () => ({ +vi.mock("@/components/logs/detail", () => ({ LogDetailsDrawer: function LogDetailsDrawerMock({ open, logEntry, diff --git a/ui/litellm-dashboard/src/components/GuardrailsMonitor/LogViewer.tsx b/ui/litellm-dashboard/src/components/GuardrailsMonitor/LogViewer.tsx index 2abd699ba86..1e2538100ae 100644 --- a/ui/litellm-dashboard/src/components/GuardrailsMonitor/LogViewer.tsx +++ b/ui/litellm-dashboard/src/components/GuardrailsMonitor/LogViewer.tsx @@ -5,8 +5,8 @@ import React, { useState } from "react"; import { Button } from "@/components/ui/button"; import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner"; import { uiSpendLogsCall } from "@/components/networking"; -import { LogDetailsDrawer } from "@/components/view_logs/LogDetailsDrawer"; -import type { LogEntry as ViewLogsLogEntry } from "@/components/view_logs/columns"; +import { LogDetailsDrawer } from "@/components/logs/detail"; +import type { LogEntry as ViewLogsLogEntry } from "@/components/logs/types"; import type { LogEntry } from "./mockData"; const actionConfig: Record< diff --git a/ui/litellm-dashboard/src/components/add_model/AutoRouterRoutingTest.tsx b/ui/litellm-dashboard/src/components/add_model/AutoRouterRoutingTest.tsx index 2b6c06e9a96..44ef0e61340 100644 --- a/ui/litellm-dashboard/src/components/add_model/AutoRouterRoutingTest.tsx +++ b/ui/litellm-dashboard/src/components/add_model/AutoRouterRoutingTest.tsx @@ -3,7 +3,7 @@ import { TriangleAlert } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Textarea } from "@/components/ui/textarea"; -import RoutingDecisionCard from "@/components/view_logs/LogDetailsDrawer/RoutingDecisionCard"; +import RoutingDecisionCard from "@/components/logs/detail/RoutingDecisionCard"; import { AutoRouterRoutingTestResult, testAutoRouterRouting } from "../networking"; import { ComplexityRouterConfigPayload, getHeuristicV2SuccessThresholdError } from "./build_complexity_router_config"; import { buildAutoRouterRoutingTestRequest } from "./build_auto_router_routing_test_request"; diff --git a/ui/litellm-dashboard/src/components/common_components/simple_table.tsx b/ui/litellm-dashboard/src/components/common_components/simple_table.tsx index a4b84d28801..8d174e49cf2 100644 --- a/ui/litellm-dashboard/src/components/common_components/simple_table.tsx +++ b/ui/litellm-dashboard/src/components/common_components/simple_table.tsx @@ -28,7 +28,7 @@ interface SimpleTableProps { /** * Simple table component for forms and settings pages - * For complex tables with sorting/filtering, use DataTable from view_logs + * For complex tables with sorting/filtering, use DataTable from shared/DataTable */ export function SimpleTable({ data, diff --git a/ui/litellm-dashboard/src/components/lens/traces/detail/RequestDetail.tsx b/ui/litellm-dashboard/src/components/lens/traces/detail/RequestDetail.tsx index 58177ede37a..242d89b21a0 100644 --- a/ui/litellm-dashboard/src/components/lens/traces/detail/RequestDetail.tsx +++ b/ui/litellm-dashboard/src/components/lens/traces/detail/RequestDetail.tsx @@ -5,7 +5,7 @@ import { useState } from "react"; import { Button } from "@/components/ui/button"; -import { LogDetailsDrawer } from "../../../view_logs/LogDetailsDrawer"; +import { LogDetailsDrawer } from "../../../logs/detail"; import { formatCost } from "../list/AgentTracesTable"; import { DetailGroup } from "./AttributesDetail"; import { CopyButton } from "../ui/CopyButton"; diff --git a/ui/litellm-dashboard/src/components/lens/traces/detail/useSpanRequestLog.ts b/ui/litellm-dashboard/src/components/lens/traces/detail/useSpanRequestLog.ts index c654ca55793..0bbc5aea1e2 100644 --- a/ui/litellm-dashboard/src/components/lens/traces/detail/useSpanRequestLog.ts +++ b/ui/litellm-dashboard/src/components/lens/traces/detail/useSpanRequestLog.ts @@ -4,7 +4,7 @@ import { useQuery, type UseQueryOptions } from "@tanstack/react-query"; import moment from "moment"; import { uiSpendLogsCall } from "../../../networking"; -import type { LogEntry } from "../../../view_logs/columns"; +import type { LogEntry } from "../../../logs/types"; /** Spend-log timestamps are written when the call finishes, so pad the span start on both sides. */ const LOOKUP_PAD_MINUTES = 30; diff --git a/ui/litellm-dashboard/src/components/view_logs/AuditLogDrawer/AuditLogDrawer.test.tsx b/ui/litellm-dashboard/src/components/logs/audit/AuditLogDrawer/AuditLogDrawer.test.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/AuditLogDrawer/AuditLogDrawer.test.tsx rename to ui/litellm-dashboard/src/components/logs/audit/AuditLogDrawer/AuditLogDrawer.test.tsx index b0672cee296..da158fb8450 100644 --- a/ui/litellm-dashboard/src/components/view_logs/AuditLogDrawer/AuditLogDrawer.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/audit/AuditLogDrawer/AuditLogDrawer.test.tsx @@ -5,7 +5,7 @@ import moment from "moment"; import { AuditLogDrawer } from "./AuditLogDrawer"; import { AuditLogEntry } from "../AuditLogsTableColumns"; -vi.mock("../../common_components/DefaultProxyAdminTag", () => ({ +vi.mock("../../../common_components/DefaultProxyAdminTag", () => ({ default: ({ userId }: { userId: string }) => {userId}, })); diff --git a/ui/litellm-dashboard/src/components/view_logs/AuditLogDrawer/AuditLogDrawer.tsx b/ui/litellm-dashboard/src/components/logs/audit/AuditLogDrawer/AuditLogDrawer.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/AuditLogDrawer/AuditLogDrawer.tsx rename to ui/litellm-dashboard/src/components/logs/audit/AuditLogDrawer/AuditLogDrawer.tsx index bb50d162181..fae3c35b80c 100644 --- a/ui/litellm-dashboard/src/components/view_logs/AuditLogDrawer/AuditLogDrawer.tsx +++ b/ui/litellm-dashboard/src/components/logs/audit/AuditLogDrawer/AuditLogDrawer.tsx @@ -2,7 +2,7 @@ import { Check, Copy } from "lucide-react"; import { useState, useCallback } from "react"; import moment from "moment"; import { AuditLogEntry, AUDIT_TABLE_NAME_DISPLAY } from "../AuditLogsTableColumns"; -import DefaultProxyAdminTag from "../../common_components/DefaultProxyAdminTag"; +import DefaultProxyAdminTag from "../../../common_components/DefaultProxyAdminTag"; import CopyButton from "@/components/shared/CopyButton"; import { StatusBadge, type StatusTone } from "@/components/shared/table_cells/status_badge"; import { Button } from "@/components/ui/button"; diff --git a/ui/litellm-dashboard/src/components/view_logs/AuditLogsPanel.test.tsx b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsPanel.test.tsx similarity index 95% rename from ui/litellm-dashboard/src/components/view_logs/AuditLogsPanel.test.tsx rename to ui/litellm-dashboard/src/components/logs/audit/AuditLogsPanel.test.tsx index 3b27f663b8e..0c83d5a2d89 100644 --- a/ui/litellm-dashboard/src/components/view_logs/AuditLogsPanel.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsPanel.test.tsx @@ -3,11 +3,11 @@ import { fireEvent, render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { chooseSelectOption } from "../../../tests/test-utils"; +import { chooseSelectOption } from "../../../../tests/test-utils"; import AuditLogsPanel from "./AuditLogsPanel"; -vi.mock("../networking", async (importOriginal) => { - const actual = await importOriginal(); +vi.mock("../../networking", async (importOriginal) => { + const actual = await importOriginal(); return { ...actual, uiAuditLogsCall: vi.fn() }; }); @@ -16,7 +16,7 @@ vi.mock("@tanstack/react-pacer/debouncer", () => ({ useDebouncedValue: (value: unknown) => [value, { cancel: vi.fn(), flush: vi.fn() }], })); -import { uiAuditLogsCall } from "../networking"; +import { uiAuditLogsCall } from "../../networking"; type AuditLogsParams = NonNullable[0]["params"]>; diff --git a/ui/litellm-dashboard/src/components/view_logs/AuditLogsPanel.tsx b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsPanel.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/AuditLogsPanel.tsx rename to ui/litellm-dashboard/src/components/logs/audit/AuditLogsPanel.tsx index 6480cb59682..f174f45a791 100644 --- a/ui/litellm-dashboard/src/components/view_logs/AuditLogsPanel.tsx +++ b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsPanel.tsx @@ -4,7 +4,7 @@ import { useQuery, keepPreviousData } from "@tanstack/react-query"; import { ColumnFiltersState, OnChangeFn, PaginationState } from "@tanstack/react-table"; import { resolveLogoSrc } from "@/lib/assetPaths"; import { DEBOUNCE_WAIT_MS } from "@/utils/debounceConstants"; -import { uiAuditLogsCall } from "../networking"; +import { uiAuditLogsCall } from "../../networking"; import { AuditLogEntry } from "./AuditLogsTableColumns"; import { AuditLogsTable } from "./AuditLogsTable"; import { AuditLogDrawer } from "./AuditLogDrawer/AuditLogDrawer"; diff --git a/ui/litellm-dashboard/src/components/view_logs/AuditLogsTable.test.tsx b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTable.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/AuditLogsTable.test.tsx rename to ui/litellm-dashboard/src/components/logs/audit/AuditLogsTable.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/AuditLogsTable.tsx b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTable.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/AuditLogsTable.tsx rename to ui/litellm-dashboard/src/components/logs/audit/AuditLogsTable.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/AuditLogsTableColumns.tsx b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTableColumns.tsx similarity index 97% rename from ui/litellm-dashboard/src/components/view_logs/AuditLogsTableColumns.tsx rename to ui/litellm-dashboard/src/components/logs/audit/AuditLogsTableColumns.tsx index 10e19e25a77..17e057a1343 100644 --- a/ui/litellm-dashboard/src/components/view_logs/AuditLogsTableColumns.tsx +++ b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTableColumns.tsx @@ -4,7 +4,7 @@ import { ColumnDef } from "@tanstack/react-table"; import { DateCell, IdCell, IdentityCell, StatusBadge, type StatusTone } from "@/components/shared/table_cells"; -import DefaultProxyAdminTag from "../common_components/DefaultProxyAdminTag"; +import DefaultProxyAdminTag from "../../common_components/DefaultProxyAdminTag"; export type AuditLogEntry = { id: string; diff --git a/ui/litellm-dashboard/src/components/view_logs/batchLogUtils.test.ts b/ui/litellm-dashboard/src/components/logs/batchLogUtils.test.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/batchLogUtils.test.ts rename to ui/litellm-dashboard/src/components/logs/batchLogUtils.test.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/batchLogUtils.ts b/ui/litellm-dashboard/src/components/logs/batchLogUtils.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/batchLogUtils.ts rename to ui/litellm-dashboard/src/components/logs/batchLogUtils.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/constants.ts b/ui/litellm-dashboard/src/components/logs/constants.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/constants.ts rename to ui/litellm-dashboard/src/components/logs/constants.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/ClassifierAuditView.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/ClassifierAuditView.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/ClassifierAuditView.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/ClassifierAuditView.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/ClassifierAuditView.tsx b/ui/litellm-dashboard/src/components/logs/detail/ClassifierAuditView.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/ClassifierAuditView.tsx rename to ui/litellm-dashboard/src/components/logs/detail/ClassifierAuditView.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/ClassifyTag.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/ClassifyTag.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/ClassifyTag.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/ClassifyTag.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/ClassifyTag.tsx b/ui/litellm-dashboard/src/components/logs/detail/ClassifyTag.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/ClassifyTag.tsx rename to ui/litellm-dashboard/src/components/logs/detail/ClassifyTag.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/CollapsibleMessage.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/CollapsibleMessage.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/CollapsibleMessage.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/CollapsibleMessage.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/CollapsibleMessage.tsx b/ui/litellm-dashboard/src/components/logs/detail/CollapsibleMessage.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/CollapsibleMessage.tsx rename to ui/litellm-dashboard/src/components/logs/detail/CollapsibleMessage.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/DrawerHeader.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/DrawerHeader.test.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/DrawerHeader.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/DrawerHeader.test.tsx index ef320f04f58..983d6650478 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/DrawerHeader.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/DrawerHeader.test.tsx @@ -2,7 +2,7 @@ import { screen, within } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; import { render } from "../../../../tests/test-utils"; -import type { LogEntry } from "../columns"; +import type { LogEntry } from "../types"; import { DrawerHeader } from "./DrawerHeader"; const logEntry = (overrides: Partial): LogEntry => diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/DrawerHeader.tsx b/ui/litellm-dashboard/src/components/logs/detail/DrawerHeader.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/DrawerHeader.tsx rename to ui/litellm-dashboard/src/components/logs/detail/DrawerHeader.tsx index a4afdb68fae..bc24614a744 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/DrawerHeader.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/DrawerHeader.tsx @@ -4,7 +4,7 @@ import moment from "moment"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; -import { LogEntry } from "../columns"; +import { LogEntry } from "../types"; import { AutoRouterTag } from "@/components/shared/table_cells"; import { ClassifyTag } from "./ClassifyTag"; import { SidebarToggle } from "./SidebarToggle"; diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/HistoryTree.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/HistoryTree.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/HistoryTree.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/HistoryTree.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/HistoryTree.tsx b/ui/litellm-dashboard/src/components/logs/detail/HistoryTree.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/HistoryTree.tsx rename to ui/litellm-dashboard/src/components/logs/detail/HistoryTree.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/InputCard.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/InputCard.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/InputCard.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/InputCard.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/InputCard.tsx b/ui/litellm-dashboard/src/components/logs/detail/InputCard.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/InputCard.tsx rename to ui/litellm-dashboard/src/components/logs/detail/InputCard.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/JsonViewer.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/JsonViewer.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/JsonViewer.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/JsonViewer.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/JsonViewer.tsx b/ui/litellm-dashboard/src/components/logs/detail/JsonViewer.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/JsonViewer.tsx rename to ui/litellm-dashboard/src/components/logs/detail/JsonViewer.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailContent.integration.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/LogDetailContent.integration.test.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailContent.integration.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/LogDetailContent.integration.test.tsx index e0551c61062..6c2569710e6 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailContent.integration.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/LogDetailContent.integration.test.tsx @@ -2,9 +2,9 @@ import { render, screen, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; import { GuardrailJumpLink, LogDetailContent } from "./LogDetailContent"; -import type { LogEntry } from "../columns"; +import type { LogEntry } from "../types"; -vi.mock("../GuardrailViewer/GuardrailViewer", () => ({ +vi.mock("./sections/GuardrailViewer/GuardrailViewer", () => ({ default: ({ data }: { data: unknown }) =>
{JSON.stringify(data)}
, })); diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailContent.tsx b/ui/litellm-dashboard/src/components/logs/detail/LogDetailContent.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailContent.tsx rename to ui/litellm-dashboard/src/components/logs/detail/LogDetailContent.tsx index f3762223e96..0da6a5e790b 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailContent.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/LogDetailContent.tsx @@ -8,11 +8,11 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/component import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner"; -import { LogEntry } from "../columns"; +import { LogEntry } from "../types"; import { formatNumberWithCommas } from "@/utils/dataUtils"; import { PROMPT_CACHE_CREATION_TOOLTIP, PROMPT_CACHE_READ_TOOLTIP } from "@/utils/promptCacheUsage"; -import GuardrailViewer from "../GuardrailViewer/GuardrailViewer"; -import EvalViewer from "../EvalViewer/EvalViewer"; +import GuardrailViewer from "./sections/GuardrailViewer/GuardrailViewer"; +import EvalViewer from "./sections/EvalViewer/EvalViewer"; import { getBatchIdFromRequestId, getBatchModels, @@ -20,9 +20,9 @@ import { getReasoningTokens, isBatchCallType, } from "../batchLogUtils"; -import { CostBreakdownViewer } from "../CostBreakdownViewer"; -import { ConfigInfoMessage } from "../ConfigInfoMessage"; -import { VectorStoreViewer } from "../VectorStoreViewer"; +import { CostBreakdownViewer } from "./sections/CostBreakdownViewer"; +import { ConfigInfoMessage } from "./sections/ConfigInfoMessage"; +import { VectorStoreViewer } from "./sections/VectorStoreViewer"; import { CREDENTIAL_LABELS } from "../constants"; import { TruncatedValue } from "./TruncatedValue"; import { TokenFlow } from "./TokenFlow"; @@ -47,7 +47,7 @@ import { FONT_FAMILY_MONO, SPACING_XLARGE, } from "./constants"; -import { ToolsSection } from "../ToolsSection"; +import { ToolsSection } from "./sections/ToolsSection"; import { PrettyMessagesView } from "./PrettyMessagesView"; import { ClassifierAuditView } from "./ClassifierAuditView"; import { AUTOROUTER_CLASSIFIER_ORIGIN } from "./ClassifyTag"; diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/LogDetailsDrawer.test.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/LogDetailsDrawer.test.tsx index f5bf7cda951..1321a4a152a 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/LogDetailsDrawer.test.tsx @@ -3,7 +3,7 @@ import { fireEvent, render, screen, waitFor } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; import { LogDetailsDrawer } from "./LogDetailsDrawer"; import { sessionSpendLogsCall } from "../../networking"; -import { LogEntry } from "../columns"; +import { LogEntry } from "../types"; import { AutoRouterModelGroupsProvider } from "@/components/shared/table_cells"; vi.mock("../../networking", () => ({ diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx b/ui/litellm-dashboard/src/components/logs/detail/LogDetailsDrawer.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx rename to ui/litellm-dashboard/src/components/logs/detail/LogDetailsDrawer.tsx index dc9207d59eb..3b4debd7e0b 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/LogDetailsDrawer.tsx @@ -2,10 +2,10 @@ import { useEffect, useMemo, useState } from "react"; import { Bot, Check, Copy, Sparkles, Wrench } from "lucide-react"; import { Sheet, SheetContent, SheetTitle } from "@/components/ui/sheet"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { LogEntry } from "../columns"; +import { LogEntry } from "../types"; import { AutoRouterIcon, useIsAutoRoutedModelGroup } from "@/components/shared/table_cells"; import { AGENT_CALL_TYPES, MCP_CALL_TYPES } from "../constants"; -import { getEventDisplayName } from "../utils"; +import { getEventDisplayName } from "./eventDisplayName"; import { ClassifyTag } from "./ClassifyTag"; import { DrawerHeader } from "./DrawerHeader"; import { SidebarToggle } from "./SidebarToggle"; diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/OutputCard.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/OutputCard.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/OutputCard.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/OutputCard.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/OutputCard.tsx b/ui/litellm-dashboard/src/components/logs/detail/OutputCard.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/OutputCard.tsx rename to ui/litellm-dashboard/src/components/logs/detail/OutputCard.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/PrettyMessagesView.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/PrettyMessagesView.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/PrettyMessagesView.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/PrettyMessagesView.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/PrettyMessagesView.tsx b/ui/litellm-dashboard/src/components/logs/detail/PrettyMessagesView.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/PrettyMessagesView.tsx rename to ui/litellm-dashboard/src/components/logs/detail/PrettyMessagesView.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/RealtimePrettyView.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/RealtimePrettyView.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/RealtimePrettyView.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/RealtimePrettyView.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/RealtimePrettyView.tsx b/ui/litellm-dashboard/src/components/logs/detail/RealtimePrettyView.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/RealtimePrettyView.tsx rename to ui/litellm-dashboard/src/components/logs/detail/RealtimePrettyView.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/RoutingDecisionCard.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/RoutingDecisionCard.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/RoutingDecisionCard.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/RoutingDecisionCard.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/RoutingDecisionCard.tsx b/ui/litellm-dashboard/src/components/logs/detail/RoutingDecisionCard.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/RoutingDecisionCard.tsx rename to ui/litellm-dashboard/src/components/logs/detail/RoutingDecisionCard.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SectionHeader.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/SectionHeader.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SectionHeader.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/SectionHeader.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SectionHeader.tsx b/ui/litellm-dashboard/src/components/logs/detail/SectionHeader.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SectionHeader.tsx rename to ui/litellm-dashboard/src/components/logs/detail/SectionHeader.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SidebarToggle.tsx b/ui/litellm-dashboard/src/components/logs/detail/SidebarToggle.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SidebarToggle.tsx rename to ui/litellm-dashboard/src/components/logs/detail/SidebarToggle.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleMessageBlock.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/SimpleMessageBlock.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleMessageBlock.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/SimpleMessageBlock.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleMessageBlock.tsx b/ui/litellm-dashboard/src/components/logs/detail/SimpleMessageBlock.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleMessageBlock.tsx rename to ui/litellm-dashboard/src/components/logs/detail/SimpleMessageBlock.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/SimpleToolCallBlock.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/SimpleToolCallBlock.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.tsx b/ui/litellm-dashboard/src/components/logs/detail/SimpleToolCallBlock.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.tsx rename to ui/litellm-dashboard/src/components/logs/detail/SimpleToolCallBlock.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TokenFlow.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/TokenFlow.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TokenFlow.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/TokenFlow.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TokenFlow.tsx b/ui/litellm-dashboard/src/components/logs/detail/TokenFlow.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TokenFlow.tsx rename to ui/litellm-dashboard/src/components/logs/detail/TokenFlow.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TruncatedValue.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/TruncatedValue.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TruncatedValue.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/TruncatedValue.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TruncatedValue.tsx b/ui/litellm-dashboard/src/components/logs/detail/TruncatedValue.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TruncatedValue.tsx rename to ui/litellm-dashboard/src/components/logs/detail/TruncatedValue.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/constants.ts b/ui/litellm-dashboard/src/components/logs/detail/constants.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/constants.ts rename to ui/litellm-dashboard/src/components/logs/detail/constants.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/utils.ts b/ui/litellm-dashboard/src/components/logs/detail/eventDisplayName.ts similarity index 93% rename from ui/litellm-dashboard/src/components/view_logs/utils.ts rename to ui/litellm-dashboard/src/components/logs/detail/eventDisplayName.ts index 37a82a7523e..09883b427d5 100644 --- a/ui/litellm-dashboard/src/components/view_logs/utils.ts +++ b/ui/litellm-dashboard/src/components/logs/detail/eventDisplayName.ts @@ -1,4 +1,4 @@ -import { MCP_CALL_TYPES } from "./constants"; +import { MCP_CALL_TYPES } from "../constants"; /** * Derive a short, human-readable display name for a log entry. diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/index.ts b/ui/litellm-dashboard/src/components/logs/detail/index.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/index.ts rename to ui/litellm-dashboard/src/components/logs/detail/index.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/prettyMessagesTypes.ts b/ui/litellm-dashboard/src/components/logs/detail/prettyMessagesTypes.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/prettyMessagesTypes.ts rename to ui/litellm-dashboard/src/components/logs/detail/prettyMessagesTypes.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/prettyMessagesUtils.ts b/ui/litellm-dashboard/src/components/logs/detail/prettyMessagesUtils.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/prettyMessagesUtils.ts rename to ui/litellm-dashboard/src/components/logs/detail/prettyMessagesUtils.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/ConfigInfoMessage.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/ConfigInfoMessage.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/ConfigInfoMessage.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/ConfigInfoMessage.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/ConfigInfoMessage.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/ConfigInfoMessage.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/ConfigInfoMessage.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/ConfigInfoMessage.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/CostBreakdownViewer.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/CostBreakdownViewer.test.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/view_logs/CostBreakdownViewer.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/CostBreakdownViewer.test.tsx index d484185f873..ee7535ca6ff 100644 --- a/ui/litellm-dashboard/src/components/view_logs/CostBreakdownViewer.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/sections/CostBreakdownViewer.test.tsx @@ -1,7 +1,7 @@ import React from "react"; import { describe, it, expect } from "vitest"; import userEvent from "@testing-library/user-event"; -import { renderWithProviders, screen } from "../../../tests/test-utils"; +import { renderWithProviders, screen } from "../../../../../tests/test-utils"; import { CostBreakdownViewer, CostBreakdown } from "./CostBreakdownViewer"; async function expandCostBreakdown() { diff --git a/ui/litellm-dashboard/src/components/view_logs/CostBreakdownViewer.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/CostBreakdownViewer.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/CostBreakdownViewer.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/CostBreakdownViewer.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/EvalViewer/EvalViewer.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/EvalViewer/EvalViewer.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/EvalViewer/EvalViewer.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/EvalViewer/EvalViewer.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/BedrockGuardrailDetails.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/BedrockGuardrailDetails.test.tsx similarity index 95% rename from ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/BedrockGuardrailDetails.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/BedrockGuardrailDetails.test.tsx index a6b75499448..a7aae99c452 100644 --- a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/BedrockGuardrailDetails.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/BedrockGuardrailDetails.test.tsx @@ -2,14 +2,14 @@ import React from "react"; import { describe, it, expect } from "vitest"; import BedrockGuardrailDetails, { BedrockGuardrailResponse, -} from "@/components/view_logs/GuardrailViewer/BedrockGuardrailDetails"; -import { renderWithProviders, screen } from "../../../../tests/test-utils"; +} from "@/components/logs/detail/sections/GuardrailViewer/BedrockGuardrailDetails"; +import { renderWithProviders, screen } from "../../../../../../tests/test-utils"; import { makeAssessment, makeBedrockCoverage, makeBedrockResponse, makeBedrockUsage, -} from "@/components/view_logs/GuardrailViewer/__tests__/fixtures"; +} from "@/components/logs/detail/sections/GuardrailViewer/__tests__/fixtures"; describe("BedrockGuardrailDetails", () => { it("returns null when response is falsy", () => { diff --git a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/BedrockGuardrailDetails.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/BedrockGuardrailDetails.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/BedrockGuardrailDetails.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/BedrockGuardrailDetails.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/CompliancePanel.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/CompliancePanel.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/CompliancePanel.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/CompliancePanel.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/ContentFilterDetails.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/ContentFilterDetails.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/ContentFilterDetails.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/ContentFilterDetails.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/GuardrailViewer.test.tsx similarity index 95% rename from ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/GuardrailViewer.test.tsx index ff5e736306a..62a5e61dfe3 100644 --- a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/GuardrailViewer.test.tsx @@ -1,19 +1,19 @@ import React from "react"; import { describe, it, expect, vi, beforeEach } from "vitest"; import userEvent from "@testing-library/user-event"; -import { renderWithProviders, screen, waitFor, within } from "../../../../tests/test-utils"; +import { renderWithProviders, screen, waitFor, within } from "../../../../../../tests/test-utils"; import { GuardrailInformation, makeBedrockResponse, makeEntity, makeGuardrailInformation, -} from "@/components/view_logs/GuardrailViewer/__tests__/fixtures"; -import GuardrailViewer from "@/components/view_logs/GuardrailViewer/GuardrailViewer"; +} from "@/components/logs/detail/sections/GuardrailViewer/__tests__/fixtures"; +import GuardrailViewer from "@/components/logs/detail/sections/GuardrailViewer/GuardrailViewer"; // We will mock child components selectively for some tests to assert prop passthrough, // but also run an integration-style render without mocks. -const PresidioPath = "@/components/view_logs/GuardrailViewer/PresidioDetectedEntities"; -const BedrockPath = "@/components/view_logs/GuardrailViewer/BedrockGuardrailDetails"; +const PresidioPath = "@/components/logs/detail/sections/GuardrailViewer/PresidioDetectedEntities"; +const BedrockPath = "@/components/logs/detail/sections/GuardrailViewer/BedrockGuardrailDetails"; const skippedPreCall: Partial = { guardrail_status: "not_run", @@ -245,7 +245,7 @@ describe("GuardrailViewer", () => { __esModule: true, default: ({ entities }: any) =>
presidio {entities?.length}
, })); - const { default: Component } = await import("@/components/view_logs/GuardrailViewer/GuardrailViewer"); + const { default: Component } = await import("@/components/logs/detail/sections/GuardrailViewer/GuardrailViewer"); const data = makeGuardrailInformation({ guardrail_provider: undefined, @@ -264,7 +264,7 @@ describe("GuardrailViewer", () => { __esModule: true, default: ({ entities }: any) =>
count:{entities?.length}
, })); - const { default: Component } = await import("@/components/view_logs/GuardrailViewer/GuardrailViewer"); + const { default: Component } = await import("@/components/logs/detail/sections/GuardrailViewer/GuardrailViewer"); const data = makeGuardrailInformation({ guardrail_provider: "presidio", @@ -283,7 +283,7 @@ describe("GuardrailViewer", () => { __esModule: true, default: ({ response }: any) =>
{response?.action ?? "no-action"}
, })); - const { default: Component } = await import("@/components/view_logs/GuardrailViewer/GuardrailViewer"); + const { default: Component } = await import("@/components/logs/detail/sections/GuardrailViewer/GuardrailViewer"); const data = makeGuardrailInformation({ guardrail_provider: "bedrock", diff --git a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/GuardrailViewer.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/GuardrailViewer.tsx index 58076ef6c00..0c5ab90f454 100644 --- a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/GuardrailViewer.tsx @@ -3,7 +3,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/comp import PresidioDetectedEntities from "./PresidioDetectedEntities"; import BedrockGuardrailDetails, { BedrockGuardrailResponse, -} from "@/components/view_logs/GuardrailViewer/BedrockGuardrailDetails"; +} from "@/components/logs/detail/sections/GuardrailViewer/BedrockGuardrailDetails"; import ContentFilterDetails from "./ContentFilterDetails"; import CompliancePanel from "./CompliancePanel"; import { getSpendString } from "@/utils/dataUtils"; diff --git a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/PresidioDetectedEntities.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/PresidioDetectedEntities.test.tsx similarity index 87% rename from ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/PresidioDetectedEntities.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/PresidioDetectedEntities.test.tsx index 77cbe3584e1..9a31349b5bc 100644 --- a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/PresidioDetectedEntities.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/PresidioDetectedEntities.test.tsx @@ -1,9 +1,9 @@ import React from "react"; import { describe, it, expect } from "vitest"; import userEvent from "@testing-library/user-event"; -import PresidioDetectedEntities from "@/components/view_logs/GuardrailViewer/PresidioDetectedEntities"; -import { renderWithProviders, screen } from "../../../../tests/test-utils"; -import { makeEntity } from "@/components/view_logs/GuardrailViewer/__tests__/fixtures"; +import PresidioDetectedEntities from "@/components/logs/detail/sections/GuardrailViewer/PresidioDetectedEntities"; +import { renderWithProviders, screen } from "../../../../../../tests/test-utils"; +import { makeEntity } from "@/components/logs/detail/sections/GuardrailViewer/__tests__/fixtures"; describe("PresidioDetectedEntities", () => { it("renders null when entities empty", () => { diff --git a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/PresidioDetectedEntities.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/PresidioDetectedEntities.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/PresidioDetectedEntities.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/PresidioDetectedEntities.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/__tests__/fixtures.ts b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/__tests__/fixtures.ts similarity index 97% rename from ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/__tests__/fixtures.ts rename to ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/__tests__/fixtures.ts index ab121adf6b4..6511d4babd6 100644 --- a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/__tests__/fixtures.ts +++ b/ui/litellm-dashboard/src/components/logs/detail/sections/GuardrailViewer/__tests__/fixtures.ts @@ -3,7 +3,7 @@ import type { BedrockAssessment, BedrockGuardrailCoverage, BedrockGuardrailUsage, -} from "@/components/view_logs/GuardrailViewer/BedrockGuardrailDetails"; +} from "@/components/logs/detail/sections/GuardrailViewer/BedrockGuardrailDetails"; export interface RecognitionMetadata { recognizer_name: string; diff --git a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/FormattedToolView.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/FormattedToolView.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/ToolsSection/FormattedToolView.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/FormattedToolView.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/JsonToolView.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/JsonToolView.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/ToolsSection/JsonToolView.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/JsonToolView.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolExpandedContent.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/ToolExpandedContent.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolExpandedContent.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/ToolExpandedContent.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolItem.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/ToolItem.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolItem.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/ToolItem.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolsSection.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/ToolsSection.test.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolsSection.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/ToolsSection.test.tsx index e146f38b42b..5885a5b736d 100644 --- a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolsSection.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/ToolsSection.test.tsx @@ -7,7 +7,7 @@ import userEvent from "@testing-library/user-event"; import { describe, it, expect } from "vitest"; import { parseToolsFromLog } from "./utils"; import { ToolsSection } from "./ToolsSection"; -import { LogEntry } from "../columns"; +import { LogEntry } from "../../../types"; const logWithTools = (toolNames: string[], calledName?: string): LogEntry => ({ request_id: "render-1", diff --git a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolsSection.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/ToolsSection.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolsSection.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/ToolsSection.tsx index e3965f182fd..a5ee65ceaa1 100644 --- a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/ToolsSection.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/ToolsSection.tsx @@ -6,7 +6,7 @@ import { useState } from "react"; import { ChevronDown, ChevronRight } from "lucide-react"; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"; -import { LogEntry } from "../columns"; +import { LogEntry } from "../../../types"; import { parseToolsFromLog } from "./utils"; import { ToolItem } from "./ToolItem"; diff --git a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/index.ts b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/index.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/ToolsSection/index.ts rename to ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/index.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/types.ts b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/types.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/ToolsSection/types.ts rename to ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/types.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/utils.test.ts b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/utils.test.ts similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/ToolsSection/utils.test.ts rename to ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/utils.test.ts index b3c118ef368..78372fe56d9 100644 --- a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/utils.test.ts +++ b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/utils.test.ts @@ -4,7 +4,7 @@ import { describe, it, expect } from "vitest"; import { parseToolsFromLog, hasTools } from "./utils"; -import { LogEntry } from "../columns"; +import { LogEntry } from "../../../types"; describe("ToolsSection utils", () => { describe("parseToolsFromLog", () => { diff --git a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/utils.ts b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/utils.ts similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/ToolsSection/utils.ts rename to ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/utils.ts index d1d1698232a..5e76a09c155 100644 --- a/ui/litellm-dashboard/src/components/view_logs/ToolsSection/utils.ts +++ b/ui/litellm-dashboard/src/components/logs/detail/sections/ToolsSection/utils.ts @@ -2,7 +2,7 @@ * Utility functions for parsing and processing tool data from log entries */ -import { LogEntry } from "../columns"; +import { LogEntry } from "../../../types"; import { ParsedTool, ToolDefinition, ToolCall } from "./types"; /** diff --git a/ui/litellm-dashboard/src/components/view_logs/VectorStoreViewer.tsx b/ui/litellm-dashboard/src/components/logs/detail/sections/VectorStoreViewer.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/view_logs/VectorStoreViewer.tsx rename to ui/litellm-dashboard/src/components/logs/detail/sections/VectorStoreViewer.tsx index 8480a123373..6b560acb90c 100644 --- a/ui/litellm-dashboard/src/components/view_logs/VectorStoreViewer.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/sections/VectorStoreViewer.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { ChevronDown, ChevronRight } from "lucide-react"; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"; -import { getProviderLogoAndName } from "../provider_info_helpers"; +import { getProviderLogoAndName } from "../../../provider_info_helpers"; interface VectorStoreContent { text: string; diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/useKeyboardNavigation.test.tsx b/ui/litellm-dashboard/src/components/logs/detail/useKeyboardNavigation.test.tsx similarity index 95% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/useKeyboardNavigation.test.tsx rename to ui/litellm-dashboard/src/components/logs/detail/useKeyboardNavigation.test.tsx index aec56296917..dfc527a6b0d 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/useKeyboardNavigation.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/detail/useKeyboardNavigation.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, renderHook } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; -import type { LogEntry } from "../columns"; +import type { LogEntry } from "../types"; import { useKeyboardNavigation } from "./useKeyboardNavigation"; const logs = [{ request_id: "first" }, { request_id: "second" }] as LogEntry[]; diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/useKeyboardNavigation.ts b/ui/litellm-dashboard/src/components/logs/detail/useKeyboardNavigation.ts similarity index 96% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/useKeyboardNavigation.ts rename to ui/litellm-dashboard/src/components/logs/detail/useKeyboardNavigation.ts index 6d30b75f312..b8f1c037cc0 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/useKeyboardNavigation.ts +++ b/ui/litellm-dashboard/src/components/logs/detail/useKeyboardNavigation.ts @@ -1,6 +1,6 @@ import { useShortcut } from "@/components/shared/useShortcut"; -import { LogEntry } from "../columns"; +import { LogEntry } from "../types"; interface UseKeyboardNavigationProps { isOpen: boolean; diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/utils.test.ts b/ui/litellm-dashboard/src/components/logs/detail/utils.test.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/utils.test.ts rename to ui/litellm-dashboard/src/components/logs/detail/utils.test.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/utils.ts b/ui/litellm-dashboard/src/components/logs/detail/utils.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/utils.ts rename to ui/litellm-dashboard/src/components/logs/detail/utils.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/LogsTableToolbar.tsx b/ui/litellm-dashboard/src/components/logs/request/LogsTableToolbar.tsx similarity index 97% rename from ui/litellm-dashboard/src/components/view_logs/LogsTableToolbar.tsx rename to ui/litellm-dashboard/src/components/logs/request/LogsTableToolbar.tsx index 3496b709d9b..4705a9057f5 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogsTableToolbar.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/LogsTableToolbar.tsx @@ -10,8 +10,8 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover import { Switch } from "@/components/ui/switch"; import { cn } from "@/lib/cva.config"; -import { QUICK_SELECT_OPTIONS } from "./constants"; -import { getTimeRangeDisplay } from "./logs_utils"; +import { QUICK_SELECT_OPTIONS } from "../constants"; +import { getTimeRangeDisplay } from "./timeRange"; const DATETIME_LOCAL_FORMAT = "YYYY-MM-DDTHH:mm"; diff --git a/ui/litellm-dashboard/src/components/view_logs/RequestLogsFilters.test.tsx b/ui/litellm-dashboard/src/components/logs/request/RequestLogsFilters.test.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/RequestLogsFilters.test.tsx rename to ui/litellm-dashboard/src/components/logs/request/RequestLogsFilters.test.tsx index 38542f033dc..f13e24b268a 100644 --- a/ui/litellm-dashboard/src/components/view_logs/RequestLogsFilters.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/RequestLogsFilters.test.tsx @@ -3,9 +3,9 @@ import userEvent from "@testing-library/user-event"; import { useState } from "react"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { chooseSelectOption, renderWithProviders, testQueryClient } from "../../../tests/test-utils"; -import { ERROR_CODE_OPTIONS } from "./constants"; -import { LOG_FILTER_IDS } from "./log_filter_logic"; +import { chooseSelectOption, renderWithProviders, testQueryClient } from "../../../../tests/test-utils"; +import { ERROR_CODE_OPTIONS } from "../constants"; +import { LOG_FILTER_IDS } from "./useLogFilterLogic"; import { RequestLogsFilters } from "./RequestLogsFilters"; vi.mock("@/app/(dashboard)/hooks/keys/useKeyAliases", () => ({ diff --git a/ui/litellm-dashboard/src/components/view_logs/RequestLogsFilters.tsx b/ui/litellm-dashboard/src/components/logs/request/RequestLogsFilters.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/view_logs/RequestLogsFilters.tsx rename to ui/litellm-dashboard/src/components/logs/request/RequestLogsFilters.tsx index e0c3205c80f..2bf893820ce 100644 --- a/ui/litellm-dashboard/src/components/view_logs/RequestLogsFilters.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/RequestLogsFilters.tsx @@ -20,9 +20,9 @@ import { import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; -import type { Team } from "../key_team_helpers/key_list"; -import { CREDENTIAL_LABELS, ERROR_CODE_OPTIONS } from "./constants"; -import { LOG_FILTER_IDS, type LogsWindow } from "./log_filter_logic"; +import type { Team } from "../../key_team_helpers/key_list"; +import { CREDENTIAL_LABELS, ERROR_CODE_OPTIONS } from "../constants"; +import { LOG_FILTER_IDS, type LogsWindow } from "./useLogFilterLogic"; const ALL_VALUE = "all"; diff --git a/ui/litellm-dashboard/src/components/view_logs/RequestLogsPanel.test.tsx b/ui/litellm-dashboard/src/components/logs/request/RequestLogsPanel.test.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/RequestLogsPanel.test.tsx rename to ui/litellm-dashboard/src/components/logs/request/RequestLogsPanel.test.tsx index aefbf68d662..d950859f22e 100644 --- a/ui/litellm-dashboard/src/components/view_logs/RequestLogsPanel.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/RequestLogsPanel.test.tsx @@ -5,12 +5,12 @@ import moment from "moment"; import { NuqsTestingAdapter, type UrlUpdateEvent } from "nuqs/adapters/testing"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { render, renderWithProviders, testQueryClient } from "../../../tests/test-utils"; -import type { LogEntry } from "./columns"; +import { render, renderWithProviders, testQueryClient } from "../../../../tests/test-utils"; +import type { LogEntry } from "../types"; import RequestLogsPanel from "./RequestLogsPanel"; -vi.mock("../networking", async (importOriginal) => { - const actual = await importOriginal(); +vi.mock("../../networking", async (importOriginal) => { + const actual = await importOriginal(); return { ...actual, uiSpendLogsCall: vi.fn(), @@ -22,7 +22,7 @@ vi.mock("@/components/key_team_helpers/filter_helpers", () => ({ fetchAllTeams: vi.fn().mockResolvedValue([]), })); -vi.mock("./LogDetailsDrawer", () => ({ +vi.mock("../detail", () => ({ LogDetailsDrawer: function LogDetailsDrawerMock({ open, logEntry, @@ -61,7 +61,7 @@ vi.mock("@tanstack/react-pacer/debouncer", () => ({ import { useDebouncedValue } from "@tanstack/react-pacer/debouncer"; import { DEBOUNCE_WAIT_MS } from "@/utils/debounceConstants"; -import { uiSpendLogsCall } from "../networking"; +import { uiSpendLogsCall } from "../../networking"; const logEntry = (overrides: Partial): LogEntry => ({ request_id: "req-1", diff --git a/ui/litellm-dashboard/src/components/view_logs/RequestLogsPanel.tsx b/ui/litellm-dashboard/src/components/logs/request/RequestLogsPanel.tsx similarity index 97% rename from ui/litellm-dashboard/src/components/view_logs/RequestLogsPanel.tsx rename to ui/litellm-dashboard/src/components/logs/request/RequestLogsPanel.tsx index ff26e30baca..605ff373c7c 100644 --- a/ui/litellm-dashboard/src/components/view_logs/RequestLogsPanel.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/RequestLogsPanel.tsx @@ -10,10 +10,10 @@ import { DEFAULT_PAGE_SIZE_OPTIONS } from "@/components/shared/DataTable"; import { Button } from "@/components/ui/button"; import { AutoRouterModelGroupsProvider } from "@/components/shared/table_cells"; import { DEBOUNCE_WAIT_MS } from "@/utils/debounceConstants"; -import type { KeyResponse } from "../key_team_helpers/key_list"; -import { keyInfoV1Call, uiSpendLogsCall } from "../networking"; -import KeyInfoView from "../templates/key_info_view"; -import type { LogEntry } from "./columns"; +import type { KeyResponse } from "../../key_team_helpers/key_list"; +import { keyInfoV1Call, uiSpendLogsCall } from "../../networking"; +import KeyInfoView from "../../templates/key_info_view"; +import type { LogEntry } from "../types"; import { DEFAULT_LOGS_SORTING, formatLogsWindow, @@ -21,9 +21,9 @@ import { LOG_FILTER_IDS, type PaginatedResponse, useLogFilterLogic, -} from "./log_filter_logic"; +} from "./useLogFilterLogic"; import { useLogDetailRouting } from "./logDetailRouting"; -import { LogDetailsDrawer } from "./LogDetailsDrawer"; +import { LogDetailsDrawer } from "../detail"; import { defaultLogsTimeRange, type LogsTimeRange, diff --git a/ui/litellm-dashboard/src/components/view_logs/RequestLogsTable.tsx b/ui/litellm-dashboard/src/components/logs/request/RequestLogsTable.tsx similarity index 96% rename from ui/litellm-dashboard/src/components/view_logs/RequestLogsTable.tsx rename to ui/litellm-dashboard/src/components/logs/request/RequestLogsTable.tsx index 0b834f43e40..822bf73302b 100644 --- a/ui/litellm-dashboard/src/components/view_logs/RequestLogsTable.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/RequestLogsTable.tsx @@ -7,10 +7,10 @@ import { useMemo, useState, type ReactNode } from "react"; import { useUserEmailLookup } from "@/app/(dashboard)/hooks/users/useUsers"; import { DataTable, DataTableFilterDrawer, DataTableToolbar } from "@/components/shared/DataTable"; -import type { Team } from "../key_team_helpers/key_list"; -import type { LogEntry } from "./columns"; -import { CREDENTIAL_LABELS, SPAN_TYPE_LABELS } from "./constants"; -import { LOG_FILTER_IDS, LOG_FILTER_LABELS, type LogsWindow } from "./log_filter_logic"; +import type { Team } from "../../key_team_helpers/key_list"; +import type { LogEntry } from "../types"; +import { CREDENTIAL_LABELS, SPAN_TYPE_LABELS } from "../constants"; +import { LOG_FILTER_IDS, LOG_FILTER_LABELS, type LogsWindow } from "./useLogFilterLogic"; import { RequestLogsFilters } from "./RequestLogsFilters"; import { getRequestLogsTableColumns } from "./RequestLogsTableColumns"; diff --git a/ui/litellm-dashboard/src/components/view_logs/RequestLogsTableColumns.test.tsx b/ui/litellm-dashboard/src/components/logs/request/RequestLogsTableColumns.test.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/view_logs/RequestLogsTableColumns.test.tsx rename to ui/litellm-dashboard/src/components/logs/request/RequestLogsTableColumns.test.tsx index c6c2714bc49..6d4a6e789b4 100644 --- a/ui/litellm-dashboard/src/components/view_logs/RequestLogsTableColumns.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/RequestLogsTableColumns.test.tsx @@ -4,7 +4,7 @@ import { describe, expect, it, vi } from "vitest"; import { DataTable } from "@/components/shared/DataTable"; -import type { LogEntry } from "./columns"; +import type { LogEntry } from "../types"; import { getRequestLogsTableColumns } from "./RequestLogsTableColumns"; const { copyToClipboardMock } = vi.hoisted(() => ({ copyToClipboardMock: vi.fn() })); diff --git a/ui/litellm-dashboard/src/components/view_logs/RequestLogsTableColumns.tsx b/ui/litellm-dashboard/src/components/logs/request/RequestLogsTableColumns.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/view_logs/RequestLogsTableColumns.tsx rename to ui/litellm-dashboard/src/components/logs/request/RequestLogsTableColumns.tsx index 80e7b512471..5d5918e4657 100644 --- a/ui/litellm-dashboard/src/components/view_logs/RequestLogsTableColumns.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/RequestLogsTableColumns.tsx @@ -7,10 +7,10 @@ import { DataTableSortHeader } from "@/components/shared/DataTable"; import { CellTooltip, DateCell, IdCell, MoneyCell, StatusBadge } from "@/components/shared/table_cells"; import { copyToClipboard, getSpendString } from "@/utils/dataUtils"; -import { getProviderLogoAndName } from "../provider_info_helpers"; -import { getBatchIdFromRequestId, getBatchRequestCounts, isBatchCallType } from "./batchLogUtils"; -import type { LogEntry } from "./columns"; -import { AGENT_CALL_TYPES, MCP_CALL_TYPES } from "./constants"; +import { getProviderLogoAndName } from "../../provider_info_helpers"; +import { getBatchIdFromRequestId, getBatchRequestCounts, isBatchCallType } from "../batchLogUtils"; +import type { LogEntry } from "../types"; +import { AGENT_CALL_TYPES, MCP_CALL_TYPES } from "../constants"; import { AgentBadge, AgentIcon, BatchBadge, LlmBadge, McpBadge, SparkleIcon, WrenchIcon } from "./TypeBadges"; export interface RequestLogsTableColumnsDeps { diff --git a/ui/litellm-dashboard/src/components/view_logs/TypeBadges.test.tsx b/ui/litellm-dashboard/src/components/logs/request/TypeBadges.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/TypeBadges.test.tsx rename to ui/litellm-dashboard/src/components/logs/request/TypeBadges.test.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/TypeBadges.tsx b/ui/litellm-dashboard/src/components/logs/request/TypeBadges.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/TypeBadges.tsx rename to ui/litellm-dashboard/src/components/logs/request/TypeBadges.tsx diff --git a/ui/litellm-dashboard/src/components/view_logs/logDetailRouting.ts b/ui/litellm-dashboard/src/components/logs/request/logDetailRouting.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/logDetailRouting.ts rename to ui/litellm-dashboard/src/components/logs/request/logDetailRouting.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/logs_utils.test.tsx b/ui/litellm-dashboard/src/components/logs/request/timeRange.test.ts similarity index 97% rename from ui/litellm-dashboard/src/components/view_logs/logs_utils.test.tsx rename to ui/litellm-dashboard/src/components/logs/request/timeRange.test.ts index b0b74df4c24..69f4f914e7d 100644 --- a/ui/litellm-dashboard/src/components/view_logs/logs_utils.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/timeRange.test.ts @@ -1,6 +1,6 @@ import moment from "moment"; import { describe, expect, it } from "vitest"; -import { getTimeRangeDisplay } from "./logs_utils"; +import { getTimeRangeDisplay } from "./timeRange"; // startTime built relative to "now"; getTimeRangeDisplay computes now() internally. const ago = (amount: number, unit: moment.unitOfTime.DurationConstructor) => diff --git a/ui/litellm-dashboard/src/components/view_logs/logs_utils.tsx b/ui/litellm-dashboard/src/components/logs/request/timeRange.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/logs_utils.tsx rename to ui/litellm-dashboard/src/components/logs/request/timeRange.ts diff --git a/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.test.tsx b/ui/litellm-dashboard/src/components/logs/request/useLogFilterLogic.test.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/view_logs/log_filter_logic.test.tsx rename to ui/litellm-dashboard/src/components/logs/request/useLogFilterLogic.test.tsx index baf713b1537..9c266759f53 100644 --- a/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.test.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/useLogFilterLogic.test.tsx @@ -15,9 +15,9 @@ import { LOGS_WINDOW_TICK_MS, useLogFilterLogic, type PaginatedResponse, -} from "./log_filter_logic"; +} from "./useLogFilterLogic"; -vi.mock("../networking", () => ({ +vi.mock("../../networking", () => ({ uiSpendLogsCall: vi.fn(), })); @@ -25,9 +25,9 @@ vi.mock("@/components/key_team_helpers/filter_helpers", () => ({ fetchAllTeams: vi.fn().mockResolvedValue([]), })); -import { uiSpendLogsCall } from "../networking"; +import { uiSpendLogsCall } from "../../networking"; import { fetchAllTeams } from "@/components/key_team_helpers/filter_helpers"; -import type { Team } from "../key_team_helpers/key_list"; +import type { Team } from "../../key_team_helpers/key_list"; const emptyResponse: PaginatedResponse = { data: [], diff --git a/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.tsx b/ui/litellm-dashboard/src/components/logs/request/useLogFilterLogic.ts similarity index 96% rename from ui/litellm-dashboard/src/components/view_logs/log_filter_logic.tsx rename to ui/litellm-dashboard/src/components/logs/request/useLogFilterLogic.ts index 8b2d9f22c15..17d7eb4b860 100644 --- a/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/useLogFilterLogic.ts @@ -1,12 +1,12 @@ import moment from "moment"; import { keepPreviousData, useQuery, type UseQueryOptions } from "@tanstack/react-query"; import type { ColumnFiltersState, PaginationState, SortingState } from "@tanstack/react-table"; -import { uiSpendLogsCall } from "../networking"; -import { Team } from "../key_team_helpers/key_list"; -import { fetchAllTeams } from "../../components/key_team_helpers/filter_helpers"; -import { teamListScopeUserId } from "../../utils/roles"; -import { defaultPageSize } from "../constants"; -import { LOGS_SORT_FIELD_MAP, type LogEntry, type LogsSortField } from "./columns"; +import { uiSpendLogsCall } from "../../networking"; +import { Team } from "../../key_team_helpers/key_list"; +import { fetchAllTeams } from "../../key_team_helpers/filter_helpers"; +import { teamListScopeUserId } from "../../../utils/roles"; +import { defaultPageSize } from "../../constants"; +import { LOGS_SORT_FIELD_MAP, type LogEntry, type LogsSortField } from "../types"; export interface PaginatedResponse { data: LogEntry[]; diff --git a/ui/litellm-dashboard/src/components/view_logs/columns.tsx b/ui/litellm-dashboard/src/components/logs/types.ts similarity index 100% rename from ui/litellm-dashboard/src/components/view_logs/columns.tsx rename to ui/litellm-dashboard/src/components/logs/types.ts diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index c297ca72141..98f3a120a49 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -116,7 +116,7 @@ import { MCP_TOOLS_PREVIEW_FORBIDDEN_MESSAGE } from "./mcp_tools/constants"; import type { ComplexityRouterConfigPayload } from "./add_model/build_complexity_router_config"; import type { AutoRouterPresetsResponse } from "@/lib/autorouter_presets"; import type { VectorStoreIndex } from "@/app/(dashboard)/vector-stores/_components/IndexesTab"; -import type { RoutingDecision } from "./view_logs/LogDetailsDrawer/RoutingDecisionCard"; +import type { RoutingDecision } from "./logs/detail/RoutingDecisionCard"; import type { SpanDetail, SpanErrorPage, Trace, TracePage } from "./lens/traces/types"; import { createApiClient, diff --git a/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx b/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx index 6a4fa2e32c3..2c57833102d 100644 --- a/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx +++ b/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx @@ -119,7 +119,7 @@ vi.mock("@/app/(dashboard)/router-settings/_components/general_settings", () => })); vi.mock("@/components/pass_through_settings", () => ({ default: stub("pass-through-settings") })); vi.mock("@/components/budgets/budget_panel", () => ({ default: stub("budget-panel") })); -vi.mock("@/components/view_logs", () => ({ default: stub("spend-logs") })); +vi.mock("@/components/logs", () => ({ default: stub("spend-logs") })); vi.mock("@/components/model_hub_table", () => ({ default: stub("model-hub-table") })); vi.mock("@/components/new_usage", () => ({ default: stub("new-usage") })); vi.mock("@/components/api_ref", () => ({ default: stub("api-ref") }));