diff --git a/ui/litellm-dashboard/.eslintrc.json b/ui/litellm-dashboard/.eslintrc.json index 30189f12c18..b9e60edb87d 100644 --- a/ui/litellm-dashboard/.eslintrc.json +++ b/ui/litellm-dashboard/.eslintrc.json @@ -74,6 +74,7 @@ "src/components/claude_code_plugins/plugin_info.tsx", "src/components/team/LoggingSettings.tsx", "src/components/DeletedTeamsPage/DeletedTeamsTable/DeletedTeamsTable.tsx", + "src/components/DeletedKeysPage/DeletedKeysTable/DeletedKeysTable.tsx", "src/components/permissions/VectorStorePermissions.tsx", "src/components/permissions/AgentPermissions.tsx", "src/components/permissions/MCPServerPermissions.tsx", diff --git a/ui/litellm-dashboard/src/components/DeletedKeysPage/DeletedKeysTable/DeletedKeysTable.tsx b/ui/litellm-dashboard/src/components/DeletedKeysPage/DeletedKeysTable/DeletedKeysTable.tsx index e0d2c05bd86..341a288dd4e 100644 --- a/ui/litellm-dashboard/src/components/DeletedKeysPage/DeletedKeysTable/DeletedKeysTable.tsx +++ b/ui/litellm-dashboard/src/components/DeletedKeysPage/DeletedKeysTable/DeletedKeysTable.tsx @@ -1,6 +1,6 @@ "use client"; import { formatNumberWithCommas } from "@/utils/dataUtils"; -import { ChevronDownIcon, ChevronUpIcon, SwitchVerticalIcon } from "@heroicons/react/outline"; +import { ArrowUpDown, ChevronDown, ChevronUp } from "lucide-react"; import { ColumnDef, flexRender, @@ -11,6 +11,7 @@ import { SortingState, useReactTable, } from "@tanstack/react-table"; +// eslint-disable-next-line litellm-ui/no-banned-ui-imports import { Table, TableBody, @@ -19,10 +20,32 @@ import { TableHeaderCell, TableRow, } from "@tremor/react"; -import { Tooltip } from "antd"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; import React, { useState } from "react"; import { KeyResponse } from "../../key_team_helpers/key_list"; +const TipSpan: React.FC<{ + value: string | null | undefined; + className: string; +}> = ({ value, className }) => { + if (!value) return -; + return ( + + + + {value} + + {value} + + + ); +}; + interface DeletedKeysTableProps { keys: KeyResponse[]; totalCount: number; @@ -66,16 +89,12 @@ export function DeletedKeysTable({ header: "Key ID", size: 150, maxSize: 250, - cell: (info) => { - const value = info.getValue() as string; - return ( - - - {value || "-"} - - - ); - }, + cell: (info) => ( + + ), }, { id: "key_alias", @@ -83,16 +102,12 @@ export function DeletedKeysTable({ header: "Key Alias", size: 150, maxSize: 200, - cell: (info) => { - const value = info.getValue() as string; - return ( - - - {value ?? "-"} - - - ); - }, + cell: (info) => ( + + ), }, { id: "team_alias", @@ -142,16 +157,12 @@ export function DeletedKeysTable({ header: "User Email", size: 160, maxSize: 250, - cell: (info) => { - const value = info.getValue() as string; - return ( - - - {value ?? "-"} - - - ); - }, + cell: (info) => ( + + ), }, { id: "user_id", @@ -159,16 +170,12 @@ export function DeletedKeysTable({ header: "User ID", size: 120, maxSize: 200, - cell: (info) => { - const userId = info.getValue() as string | null; - return ( - - - {userId || "-"} - - - ); - }, + cell: (info) => ( + + ), }, { id: "created_at", @@ -192,13 +199,13 @@ export function DeletedKeysTable({ size: 120, maxSize: 180, cell: (info) => { - const value = (info.row.original as any).created_by as string | null | undefined; + const value = (info.row.original as { created_by?: string | null }) + .created_by; return ( - - - {value || "-"} - - + ); }, }, @@ -209,7 +216,8 @@ export function DeletedKeysTable({ size: 120, maxSize: 140, cell: (info) => { - const value = (info.row.original as any).deleted_at as string | null | undefined; + const value = (info.row.original as { deleted_at?: string | null }) + .deleted_at; return ( {value ? new Date(value).toLocaleDateString() : "-"} @@ -224,13 +232,13 @@ export function DeletedKeysTable({ size: 120, maxSize: 180, cell: (info) => { - const value = (info.row.original as any).deleted_by as string | null | undefined; + const value = (info.row.original as { deleted_by?: string | null }) + .deleted_by; return ( - - - {value || "-"} - - + ); }, }, @@ -270,34 +278,38 @@ export function DeletedKeysTable({ {isLoading || isFetching ? ( - Loading... + + Loading... + ) : ( - + Showing {rangeLabel} of {totalCount} results )} {isLoading || isFetching ? ( - Loading... + Loading... ) : ( - + Page {currentPageIndex + 1} of {table.getPageCount()} )} table.previousPage()} disabled={isLoading || isFetching || !table.getCanPreviousPage()} - className="px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed" + className="px-3 py-1 text-sm border border-border rounded-md hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed" > Previous table.nextPage()} disabled={isLoading || isFetching || !table.getCanNextPage()} - className="px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed" + className="px-3 py-1 text-sm border border-border rounded-md hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed" > Next @@ -314,7 +326,7 @@ export function DeletedKeysTable({ {header.column.getIsSorted() ? ( { - asc: , - desc: , + asc: ( + + ), + desc: ( + + ), }[header.column.getIsSorted() as string] ) : ( - + )} {isLoading || isFetching ? ( - - + + 🚅 Loading keys... @@ -404,8 +423,11 @@ export function DeletedKeysTable({ )) ) : ( - - + + No deleted keys found
🚅 Loading keys...
No deleted keys found