diff --git a/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.test.tsx b/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.test.tsx index d992ff0ecb4..8d64d727189 100644 --- a/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.test.tsx +++ b/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.test.tsx @@ -19,7 +19,7 @@ vi.mock("../networking", () => ({ // Mock scrollIntoView which is not available in jsdom beforeEach(() => { - Element.prototype.scrollIntoView = () => {}; + Element.prototype.scrollIntoView = () => { }; }); describe("ChatUI", () => { @@ -270,4 +270,43 @@ describe("ChatUI", () => { expect(mcpSelect).not.toHaveClass("ant-select-disabled"); }); }); + + it("should show Fill button and populate customProxyBaseUrl when proxySettings.LITELLM_UI_API_DOC_BASE_URL is provided", async () => { + const testProxyUrl = "http://localhost:5000"; + + render( + , + ); + + await waitFor(() => { + expect(screen.getByText("Test Key")).toBeInTheDocument(); + }); + + const fillButton = screen.getByText("Fill"); + expect(fillButton).toBeInTheDocument(); + + act(() => { + fireEvent.click(fillButton); + }); + + await waitFor(() => { + expect(sessionStorage.getItem("customProxyBaseUrl")).toBe(testProxyUrl); + }); + + await waitFor(() => { + expect(screen.queryByText("Fill")).toBeNull(); + }); + + const customProxyInput = screen.getByPlaceholderText("Optional: Enter custom proxy URL (e.g., http://localhost:5000)"); + expect(customProxyInput).toHaveValue(testProxyUrl); + }); }); diff --git a/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx b/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx index cbdffe46819..a3bdaccd805 100644 --- a/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx +++ b/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx @@ -10,6 +10,7 @@ import { FilePdfOutlined, InfoCircleOutlined, KeyOutlined, + LinkOutlined, LoadingOutlined, PictureOutlined, RobotOutlined, @@ -1172,9 +1173,23 @@ const ChatUI: React.FC = ({
- + Custom Proxy Base URL + {proxySettings?.LITELLM_UI_API_DOC_BASE_URL && !customProxyBaseUrl && ( + + )} {customProxyBaseUrl && (
@@ -2071,11 +2086,10 @@ const ChatUI: React.FC = ({ } >