diff --git a/ui/litellm-dashboard/src/components/add_pass_through.tsx b/ui/litellm-dashboard/src/components/add_pass_through.tsx index f2e8c225312..462d5b424e7 100644 --- a/ui/litellm-dashboard/src/components/add_pass_through.tsx +++ b/ui/litellm-dashboard/src/components/add_pass_through.tsx @@ -7,7 +7,6 @@ import React, { useState, useEffect, useRef } from "react"; import { Button, TextInput, Grid, Col, Switch } from "@tremor/react"; import { Select, SelectItem, MultiSelect, MultiSelectItem, Card, Metric, Text, Title, Subtitle, Accordion, AccordionHeader, AccordionBody, } from "@tremor/react"; -import { CopyToClipboard } from 'react-copy-to-clipboard'; import { createPassThroughEndpoint } from "./networking"; import { Button as Button2, @@ -67,6 +66,7 @@ const AddPassThroughEndpoint: React.FC = ({ }; const addPassThrough = async (formValues: Record) => { + console.log("addPassThrough called with:", formValues); setIsLoading(true); try { console.log(`formValues: ${JSON.stringify(formValues)}`); @@ -143,7 +143,11 @@ const AddPassThroughEndpoint: React.FC = ({ onFinish={addPassThrough} layout="vertical" className="space-y-6" - initialValues={{ include_subpath: true }} + initialValues={{ + include_subpath: true, + path: pathValue, + target: targetValue + }} > {/* Route Configuration Section */} @@ -154,26 +158,24 @@ const AddPassThroughEndpoint: React.FC = ({ - Path Prefix * + Path Prefix } name="path" rules={[ - { required: true, message: '' }, - { pattern: /^\//, message: '' } + { required: true, message: 'Path is required', pattern: /^\// } ]} extra={
- Example: /bria, /openai, /anthropic + Example: /bria, /adobe-photoshop, /elasticsearch
} className="mb-4" >
- / handlePathChange(e.target.value)} className="flex-1" /> @@ -183,17 +185,17 @@ const AddPassThroughEndpoint: React.FC = ({ - Target URL * + Target URL } name="target" rules={[ - { required: true, message: '' }, - { type: 'url', message: '' } + { required: true, message: 'Target URL is required' }, + { type: 'url', message: 'Please enter a valid URL' } ]} extra={
- Example: https://api.openai.com, https://engine.prod.bria-api.com + Example:https://engine.prod.bria-api.com
} className="mb-4" @@ -201,7 +203,10 @@ const AddPassThroughEndpoint: React.FC = ({ setTargetValue(e.target.value)} + onChange={(e) => { + setTargetValue(e.target.value); + form.setFieldsValue({ target: e.target.value }); + }} />
@@ -300,6 +305,10 @@ const AddPassThroughEndpoint: React.FC = ({