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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
feat(ui): link the Created By cell on the Prompts page (#40753)
ryan-crabbe-berric53f72c764f9
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/PromptTable.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/PromptTable.test.tsxindex edbb897fb2f..009abf93d1f 100644--- a/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/PromptTable.test.tsx+++ b/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/PromptTable.test.tsx@@ -10,6 +10,8 @@ vi.mock("@/components/networking", () => ({modelHubCall: vi.fn().mockResolvedValue({ data: [] }),}));+vi.mock("next/navigation", () => ({ useRouter: () => ({ push: vi.fn() }) }));+const mockPrompts: PromptSpec[] = [{prompt_id: "prompt-newer",@@ -53,6 +55,15 @@ describe("PromptTable", () => {}});+ it("links the Created By cell to the creator's detail page, leaving the placeholder unlinked", () => {+ const prompts = [mockPrompts[0], { ...mockPrompts[1], created_by: "default_user_id" }];+ render(<PromptTable {...defaultProps} promptsList={prompts} />);++ expect(screen.getByRole("link", { name: "user-1" })).toHaveAttribute("href", "/ui/users?user=user-1");+ expect(screen.getByText("default_user_id")).toBeInTheDocument();+ expect(screen.queryByRole("link", { name: "default_user_id" })).not.toBeInTheDocument();+ });+it("should display the empty state when data is empty", () => {render(<PromptTable {...defaultProps} promptsList={[]} />);expect(screen.getByText("No prompts yet")).toBeInTheDocument();diff --git a/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/PromptTableColumns.tsx b/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/PromptTableColumns.tsxindex f927a6d1486..db0392bbd6e 100644--- a/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/PromptTableColumns.tsx+++ b/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/PromptTableColumns.tsx@@ -17,6 +17,7 @@ import {} from "@/components/ui/dropdown-menu";import { cn } from "@/lib/cva.config";import { copyToClipboard } from "@/utils/dataUtils";+import { userDetailHref } from "@/utils/entityLinks";import { extractModel, getProviderFromModelHub, ModelGroupInfo } from "./prompt_utils";@@ -191,9 +192,16 @@ export const getPromptTableColumns = ({enableSorting: false,cell: ({ row }) => {const createdBy = row.original.created_by;+ if (!createdBy) {+ return <span className="text-muted-foreground">-</span>;+ }return (- <span className="block max-w-60 truncate text-sm text-muted-foreground" title={createdBy}>- {createdBy || "-"}+ <span className="block max-w-60" title={createdBy}>+ <IdentityCell+ title={createdBy}+ titleClassName="font-normal text-muted-foreground"+ href={userDetailHref(createdBy)}+ /></span>);},