Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

feat(ui): add click-to-copy icon on User ID in internal users table

Ryan Crabbe1d7cff22cb80
diff --git a/ui/litellm-dashboard/src/components/view_users/columns.tsx b/ui/litellm-dashboard/src/components/view_users/columns.tsx
index 73750d7a48a..4b9fad8f23c 100644
--- a/ui/litellm-dashboard/src/components/view_users/columns.tsx
+++ b/ui/litellm-dashboard/src/components/view_users/columns.tsx
@@ -3,7 +3,8 @@ import { Badge, Grid, Icon } from "@tremor/react";
import { Tooltip, Checkbox } from "antd";
import { UserInfo } from "./types";
import { PencilAltIcon, TrashIcon, InformationCircleIcon, RefreshIcon } from "@heroicons/react/outline";
-import { formatNumberWithCommas } from "@/utils/dataUtils";
+import { CopyOutlined } from "@ant-design/icons";
+import { formatNumberWithCommas, copyToClipboard } from "@/utils/dataUtils";
interface SelectionOptions {
selectedUsers: UserInfo[];
@@ -29,9 +30,22 @@ export const columns = (
accessorKey: "user_id",
enableSorting: true,
cell: ({ row }) => (
- <Tooltip title={row.original.user_id}>
- <span className="text-xs">{row.original.user_id ? `${row.original.user_id.slice(0, 7)}...` : "-"}</span>
- </Tooltip>
+ <div className="flex items-center space-x-2">
+ <Tooltip title={row.original.user_id}>
+ <span className="text-xs">{row.original.user_id ? `${row.original.user_id.slice(0, 7)}...` : "-"}</span>
+ </Tooltip>
+ {row.original.user_id && (
+ <Tooltip title="Copy User ID">
+ <CopyOutlined
+ onClick={(e) => {
+ e.stopPropagation();
+ copyToClipboard(row.original.user_id, "User ID copied to clipboard");
+ }}
+ className="cursor-pointer text-gray-500 hover:text-blue-500 text-xs"
+ />
+ </Tooltip>
+ )}
+ </div>
),
},
{