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]

refactor(ui): move the virtual key create and edit forms off tremor (#37324)

ryan-crabbe-berri92cf577f8257
diff --git a/ui/litellm-dashboard/eslint-suppressions.json b/ui/litellm-dashboard/eslint-suppressions.json
index e11ff09d41b..5e285467284 100644
--- a/ui/litellm-dashboard/eslint-suppressions.json
+++ b/ui/litellm-dashboard/eslint-suppressions.json
@@ -2105,7 +2105,7 @@
},
"src/components/common_components/AccessGroupSelector.tsx": {
"no-restricted-imports": {
- "count": 2
+ "count": 1
}
},
"src/components/common_components/DeleteResourceModal.tsx": {
@@ -2123,7 +2123,7 @@
"count": 1
},
"no-restricted-imports": {
- "count": 2
+ "count": 1
}
},
"src/components/common_components/MetadataKeyValueFields.test.tsx": {
@@ -2474,7 +2474,7 @@
},
"src/components/organisms/create_key_button.test.tsx": {
"@typescript-eslint/no-require-imports": {
- "count": 2
+ "count": 1
},
"react/display-name": {
"count": 8
@@ -2491,7 +2491,7 @@
"count": 1
},
"no-restricted-imports": {
- "count": 2
+ "count": 1
},
"prefer-const": {
"count": 2
@@ -2791,7 +2791,7 @@
"count": 2
},
"no-restricted-imports": {
- "count": 2
+ "count": 1
}
},
"src/components/templates/key_info_view.tsx": {
diff --git a/ui/litellm-dashboard/src/components/common_components/AccessGroupSelector.tsx b/ui/litellm-dashboard/src/components/common_components/AccessGroupSelector.tsx
index 0ee363f9d1e..4b73fb561d0 100644
--- a/ui/litellm-dashboard/src/components/common_components/AccessGroupSelector.tsx
+++ b/ui/litellm-dashboard/src/components/common_components/AccessGroupSelector.tsx
@@ -1,7 +1,6 @@
import React from "react";
import { Select, Skeleton } from "antd";
import { TeamOutlined } from "@ant-design/icons";
-import { Text } from "@tremor/react";
import { useAccessGroups, AccessGroupResponse } from "@/app/(dashboard)/hooks/accessGroups/useAccessGroups";
export interface AccessGroupSelectorProps {
@@ -43,9 +42,9 @@ const AccessGroupSelector: React.FC<AccessGroupSelectorProps> = ({
return (
<div>
{showLabel && (
- <Text className="font-medium block mb-2 text-gray-700 flex items-center">
+ <p className="text-sm font-medium block mb-2 text-gray-700 flex items-center">
<TeamOutlined className="mr-2" /> {labelText}
- </Text>
+ </p>
)}
<Skeleton.Input active block style={{ height: 32, ...style }} />
</div>
@@ -69,9 +68,9 @@ const AccessGroupSelector: React.FC<AccessGroupSelectorProps> = ({
return (
<div>
{showLabel && (
- <Text className="font-medium block mb-2 text-gray-700 flex items-center">
+ <p className="text-sm font-medium block mb-2 text-gray-700 flex items-center">
<TeamOutlined className="mr-2" /> {labelText}
- </Text>
+ </p>
)}
<Select
mode="multiple"
diff --git a/ui/litellm-dashboard/src/components/organisms/create_key_button.test.tsx b/ui/litellm-dashboard/src/components/organisms/create_key_button.test.tsx
index 8df77246140..7c9eed62c89 100644
--- a/ui/litellm-dashboard/src/components/organisms/create_key_button.test.tsx
+++ b/ui/litellm-dashboard/src/components/organisms/create_key_button.test.tsx
@@ -63,25 +63,6 @@ vi.mock("react-copy-to-clipboard", () => ({
CopyToClipboard: ({ children }: { children: any }) => children,
}));
-vi.mock("@tremor/react", () => {
- const React = require("react");
- const Stub = ({ children }: { children?: any }) => React.createElement("div", null, children);
- const Button = ({ children, ...props }: { children?: any }) => React.createElement("button", props, children);
- const TextInput = (props: any) => React.createElement("input", props);
-
- return {
- Accordion: Stub,
- AccordionBody: Stub,
- AccordionHeader: Stub,
- Button,
- Col: Stub,
- Grid: Stub,
- Text: Stub,
- TextInput,
- Title: Stub,
- };
-});
-
vi.mock("antd", () => {
const React = require("react");
@@ -385,6 +366,13 @@ describe("CreateKey", () => {
addKey: vi.fn(),
};
+ const openOptionalSettings = async () => {
+ const trigger = await screen.findByRole("button", { name: /optional settings/i });
+ act(() => {
+ fireEvent.click(trigger);
+ });
+ };
+
beforeEach(() => {
vi.clearAllMocks();
if (typeof window !== "undefined" && window.localStorage && typeof window.localStorage.clear === "function") {
@@ -428,6 +416,8 @@ describe("CreateKey", () => {
fireEvent.click(screen.getByRole("button", { name: /create new key/i }));
});
+ await openOptionalSettings();
+
await waitFor(() => {
expect(screen.getByTestId("access-group-selector")).toBeInTheDocument();
});
@@ -777,6 +767,8 @@ describe("CreateKey", () => {
fireEvent.click(screen.getByRole("button", { name: /create new key/i }));
});
+ await openOptionalSettings();
+
await waitFor(() => {
expect(screen.getByText("production")).toBeInTheDocument();
expect(screen.getByText("staging")).toBeInTheDocument();
@@ -788,11 +780,12 @@ describe("CreateKey", () => {
const POLICIES_PLACEHOLDER = "Premium feature - Upgrade to set policies by key";
const PROMPTS_PLACEHOLDER = "Premium feature - Upgrade to set prompts by key";
- const openModal = () => {
+ const openModal = async () => {
renderWithProviders(<CreateKey {...defaultProps} />);
act(() => {
fireEvent.click(screen.getByRole("button", { name: /create new key/i }));
});
+ await openOptionalSettings();
};
beforeEach(() => {
@@ -801,7 +794,7 @@ describe("CreateKey", () => {
});
it("should load and offer both selectors for an admin", async () => {
- openModal();
+ await openModal();
await waitFor(() => {
expect(screen.getByRole("option", { name: "policy-a" })).toBeInTheDocument();
@@ -816,7 +809,7 @@ describe("CreateKey", () => {
it("should omit both selectors and fire neither admin-only request for an internal user", async () => {
authorizedState = { ...defaultAuthorizedState, userRole: "Internal User" };
- openModal();
+ await openModal();
expect(await screen.findByTestId("org-dropdown")).toBeInTheDocument();
@@ -835,6 +828,8 @@ describe("CreateKey", () => {
fireEvent.click(screen.getByRole("button", { name: /create new key/i }));
});
+ await openOptionalSettings();
+
await waitFor(() => {
expect(screen.getByTestId("budget-duration-dropdown")).toBeInTheDocument();
});
diff --git a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx
index ab0e381bbd8..9bb5ed51bfa 100644
--- a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx
+++ b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx
@@ -9,8 +9,22 @@ import useCan from "@/app/(dashboard)/hooks/useCan";
import { formatNumberWithCommas } from "@/utils/dataUtils";
import { InfoCircleOutlined } from "@ant-design/icons";
import { useQueryClient } from "@tanstack/react-query";
-import { Accordion, AccordionBody, AccordionHeader, Button, Col, Grid, Text, TextInput, Title } from "@tremor/react";
-import { Button as Button2, Form, Input, Modal, Radio, Select, Switch, Tag, Tooltip, Typography } from "antd";
+import { Button } from "@/components/ui/button";
+import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";
+import { Input } from "@/components/ui/input";
+import {
+ Button as Button2,
+ Form,
+ Input as AntdInput,
+ Modal,
+ Radio,
+ Select,
+ Switch,
+ Tag,
+ Tooltip,
+ Typography,
+} from "antd";
+import { ChevronDown } from "lucide-react";
import { useDebouncedCallback } from "@tanstack/react-pacer/debouncer";
import { DEBOUNCE_WAIT_MS } from "@/utils/debounceConstants";
import React, { useEffect, useState } from "react";
@@ -62,6 +76,10 @@ import { simplifyKeyGenerateError } from "./utils";
const { Option } = Select;
+const SECTION_HEADER_CLASS = "group/section flex w-full items-center justify-between px-4 py-3 text-left";
+const SECTION_CHEVRON_CLASS =
+ "size-5 shrink-0 text-gray-500 transition-transform group-data-[panel-open]/section:rotate-180";
+
/**
* Interface for pre-filling the create key form from URL parameters
*/
@@ -691,7 +709,7 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
<Form form={form} onFinish={handleCreate} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} labelAlign="left">
{/* Section 1: Key Ownership */}
<div className="mb-8">
- <Title className="mb-4">Key Ownership</Title>
+ <h3 className="text-lg font-medium text-gray-900 mb-4">Key Ownership</h3>
<Form.Item
label={
<span>
@@ -878,17 +896,17 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
{/* Show message when team selection is required */}
{isFormDisabled && (
<div className="mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md">
- <Text className="text-blue-800 text-sm">
+ <p className="text-blue-800 text-sm">
Please select a team to continue configuring your Virtual Key. If you do not see any teams, please
contact your Proxy Admin to either provide you with access to models or to add you to a team.
- </Text>
+ </p>
</div>
)}
{/* Section 2: Key Details */}
{!isFormDisabled && (
<div className="mb-8">
- <Title className="mb-4">Key Details</Title>
+ <h3 className="text-lg font-medium text-gray-900 mb-4">Key Details</h3>
<Form.Item
label={
<span>
@@ -913,7 +931,7 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
]}
help="required"
>
- <TextInput placeholder="" />
+ <Input />
</Form.Item>
<Form.Item
@@ -1023,11 +1041,14 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
{/* Section 3: Optional Settings */}
{!isFormDisabled && (
<div className="mb-8">
- <Accordion className="mt-4 mb-4">
- <AccordionHeader>
- <Title className="m-0">Optional Settings</Title>
- </AccordionHeader>
- <AccordionBody>
+ <Collapsible className="mt-4 mb-4 overflow-hidden rounded-lg border">
+ <h3 className="m-0 text-lg font-medium text-gray-900">
+ <CollapsibleTrigger className={SECTION_HEADER_CLASS}>
+ Optional Settings
+ <ChevronDown className={SECTION_CHEVRON_CLASS} />
+ </CollapsibleTrigger>
+ </h3>
+ <CollapsibleContent className="px-4 pb-3">
<Form.Item
className="mt-4"
label={
@@ -1418,7 +1439,7 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
name="metadata"
className="mt-4"
>
- <Input.TextArea rows={4} placeholder="Enter metadata as JSON" />
+ <AntdInput.TextArea rows={4} placeholder="Enter metadata as JSON" />
</Form.Item>
<Form.Item
label={
@@ -1441,11 +1462,12 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
options={tagOptions}
/>
</Form.Item>
- <Accordion className="mt-4 mb-4">
- <AccordionHeader>
+ <Collapsible className="mt-4 mb-4 overflow-hidden rounded-lg border">
+ <CollapsibleTrigger className={SECTION_HEADER_CLASS}>
<b>MCP Settings</b>
- </AccordionHeader>
- <AccordionBody>
+ <ChevronDown className={SECTION_CHEVRON_CLASS} />
+ </CollapsibleTrigger>
+ <CollapsibleContent className="px-4 pb-3">
<Form.Item
label={
<span>
@@ -1470,7 +1492,7 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
{/* Hidden field to register mcp_tool_permissions with the form */}
<Form.Item name="mcp_tool_permissions" initialValue={{}} hidden>
- <Input type="hidden" />
+ <AntdInput type="hidden" />
</Form.Item>
<Form.Item
@@ -1493,14 +1515,15 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
</div>
)}
</Form.Item>
- </AccordionBody>
- </Accordion>
+ </CollapsibleContent>
+ </Collapsible>
- <Accordion className="mt-4 mb-4">
- <AccordionHeader>
+ <Collapsible className="mt-4 mb-4 overflow-hidden rounded-lg border">
+ <CollapsibleTrigger className={SECTION_HEADER_CLASS}>
<b>Agent Settings</b>
- </AccordionHeader>
- <AccordionBody>
+ <ChevronDown className={SECTION_CHEVRON_CLASS} />
+ </CollapsibleTrigger>
+ <CollapsibleContent className="px-4 pb-3">
<Form.Item
label={
<span>
@@ -1520,15 +1543,16 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
placeholder="Select agents or access groups (optional)"
/>
</Form.Item>
- </AccordionBody>
- </Accordion>
+ </CollapsibleContent>
+ </Collapsible>
{premiumUser ? (
- <Accordion className="mt-4 mb-4">
- <AccordionHeader>
+ <Collapsible className="mt-4 mb-4 overflow-hidden rounded-lg border">
+ <CollapsibleTrigger className={SECTION_HEADER_CLASS}>
<b>Logging Settings</b>
- </AccordionHeader>
- <AccordionBody>
+ <ChevronDown className={SECTION_CHEVRON_CLASS} />
+ </CollapsibleTrigger>
+ <CollapsibleContent className="px-4 pb-3">
<div className="mt-4">
<PremiumLoggingSettings
value={loggingSettings}
@@ -1538,8 +1562,8 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
onDisabledCallbacksChange={setDisabledCallbacks}
/>
</div>
- </AccordionBody>
- </Accordion>
+ </CollapsibleContent>
+ </Collapsible>
) : (
<Tooltip
title={
@@ -1554,11 +1578,12 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
>
<div style={{ position: "relative" }}>
<div style={{ opacity: 0.5 }}>
- <Accordion className="mt-4 mb-4">
- <AccordionHeader>
+ <Collapsible className="mt-4 mb-4 overflow-hidden rounded-lg border">
+ <CollapsibleTrigger className={SECTION_HEADER_CLASS}>
<b>Logging Settings</b>
- </AccordionHeader>
- <AccordionBody>
+ <ChevronDown className={SECTION_CHEVRON_CLASS} />
+ </CollapsibleTrigger>
+ <CollapsibleContent className="px-4 pb-3">
<div className="mt-4">
<PremiumLoggingSettings
value={loggingSettings}
@@ -1568,19 +1593,23 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
onDisabledCallbacksChange={setDisabledCallbacks}
/>
</div>
- </AccordionBody>
- </Accordion>
+ </CollapsibleContent>
+ </Collapsible>
</div>
<div style={{ position: "absolute", inset: 0, cursor: "not-allowed" }} />
</div>
</Tooltip>
)}
- <Accordion key={`router-settings-accordion-${routerSettingsKey}`} className="mt-4 mb-4">
- <AccordionHeader>
+ <Collapsible
+ key={`router-settings-accordion-${routerSettingsKey}`}
+ className="mt-4 mb-4 overflow-hidden rounded-lg border"
+ >
+ <CollapsibleTrigger className={SECTION_HEADER_CLASS}>
<b>Router Settings</b>
- </AccordionHeader>
- <AccordionBody>
+ <ChevronDown className={SECTION_CHEVRON_CLASS} />
+ </CollapsibleTrigger>
+ <CollapsibleContent className="px-4 pb-3">
<div className="mt-4 w-full">
<RouterSettingsAccordion
key={routerSettingsKey}
@@ -1594,19 +1623,20 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
}
/>
</div>
- </AccordionBody>
- </Accordion>
+ </CollapsibleContent>
+ </Collapsible>
- <Accordion className="mt-4 mb-4">
- <AccordionHeader>
+ <Collapsible className="mt-4 mb-4 overflow-hidden rounded-lg border">
+ <CollapsibleTrigger className={SECTION_HEADER_CLASS}>
<b>Model Aliases</b>
- </AccordionHeader>
- <AccordionBody>
+ <ChevronDown className={SECTION_CHEVRON_CLASS} />
+ </CollapsibleTrigger>
+ <CollapsibleContent className="px-4 pb-3">
<div className="mt-4">
- <Text className="text-sm text-gray-600 mb-4">
+ <p className="text-sm text-gray-600 mb-4">
Create custom aliases for models that can be used in API calls. This allows you to create
shortcuts for specific models.
- </Text>
+ </p>
<ModelAliasManager
accessToken={accessToken}
initialModelAliases={modelAliases}
@@ -1614,14 +1644,15 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
showExampleConfig={false}
/>
</div>
- </AccordionBody>
- </Accordion>
+ </CollapsibleContent>
+ </Collapsible>
- <Accordion className="mt-4 mb-4">
- <AccordionHeader>
+ <Collapsible className="mt-4 mb-4 overflow-hidden rounded-lg border">
+ <CollapsibleTrigger className={SECTION_HEADER_CLASS}>
<b>Key Lifecycle</b>
- </AccordionHeader>
- <AccordionBody>
+ <ChevronDown className={SECTION_CHEVRON_CLASS} />
+ </CollapsibleTrigger>
+ <CollapsibleContent className="px-4 pb-3">
<div className="mt-4">
<Form.Item name="duration" initialValue="" noStyle>
<KeyLifecycleSettings
@@ -1633,10 +1664,10 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
/>
</Form.Item>
</div>
- </AccordionBody>
- </Accordion>
- <Accordion className="mt-4 mb-4">
- <AccordionHeader>
+ </CollapsibleContent>
+ </Collapsible>
+ <Collapsible className="mt-4 mb-4 overflow-hidden rounded-lg border">
+ <CollapsibleTrigger className={SECTION_HEADER_CLASS}>
<div className="flex items-center gap-2">
<b>Advanced Settings</b>
<Tooltip
@@ -1661,8 +1692,9 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
<InfoCircleOutlined className="text-gray-400 hover:text-gray-300 cursor-help" />
</Tooltip>
</div>
- </AccordionHeader>
- <AccordionBody>
+ <ChevronDown className={SECTION_CHEVRON_CLASS} />
+ </CollapsibleTrigger>
+ <CollapsibleContent className="px-4 pb-3">
<SchemaFormFields
schemaComponent="GenerateKeyRequest"
form={form}
@@ -1682,10 +1714,10 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
...(disableCustomApiKeys ? ["key"] : []),
]}
/>
- </AccordionBody>
- </Accordion>
- </AccordionBody>
- </Accordion>
+ </CollapsibleContent>
+ </Collapsible>
+ </CollapsibleContent>
+ </Collapsible>
</div>
)}
@@ -1718,16 +1750,14 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey, autoOp
{apiKey && (
<Modal open={isModalVisible} onOk={handleOk} onCancel={handleCancel} footer={null}>
- <Grid numItems={1} className="gap-2 w-full">
- <Title>Save your Key</Title>
- <Col numColSpan={1}>
- {apiKey != null ? (
- <CreatedKeyDisplay apiKey={apiKey} />
- ) : (
- <Text>Key being created, this might take 30s</Text>
- )}
- </Col>
- </Grid>
+ <div className="grid grid-cols-1 gap-2 w-full">
+ <h3 className="text-lg font-medium text-gray-900">Save your Key</h3>
+ {apiKey != null ? (
+ <CreatedKeyDisplay apiKey={apiKey} />
+ ) : (
+ <p className="text-sm">Key being created, this might take 30s</p>
+ )}
+ </div>
</Modal>
)}
</div>
diff --git a/ui/litellm-dashboard/src/components/templates/key_edit_view.test.tsx b/ui/litellm-dashboard/src/components/templates/key_edit_view.test.tsx
index 56357acdbfa..4a3fd50b379 100644
--- a/ui/litellm-dashboard/src/components/templates/key_edit_view.test.tsx
+++ b/ui/litellm-dashboard/src/components/templates/key_edit_view.test.tsx
@@ -372,13 +372,14 @@ describe("KeyEditView", () => {
});
});
- it("should call onCancel when cancel button is clicked", async () => {
+ it("should call onCancel without submitting the form when cancel button is clicked", async () => {
const onCancelMock = vi.fn();
+ const onSubmitMock = vi.fn().mockResolvedValue(undefined);
renderWithProviders(
<KeyEditView
keyData={MOCK_KEY_DATA}
onCancel={onCancelMock}
- onSubmit={async () => {}}
+ onSubmit={onSubmitMock}
accessToken={""}
userID={""}
userRole={""}
@@ -386,14 +387,11 @@ describe("KeyEditView", () => {
/>,
);
- await waitFor(() => {
- expect(screen.getByRole("button", { name: /cancel/i })).toBeInTheDocument();
- });
-
- const cancelButton = screen.getByRole("button", { name: /cancel/i });
+ const cancelButton = await screen.findByRole("button", { name: /cancel/i });
await userEvent.click(cancelButton);
expect(onCancelMock).toHaveBeenCalledTimes(1);
+ expect(onSubmitMock).not.toHaveBeenCalled();
});
it("should display key alias input field", async () => {
diff --git a/ui/litellm-dashboard/src/components/templates/key_edit_view.tsx b/ui/litellm-dashboard/src/components/templates/key_edit_view.tsx
index a39989153f4..25e0992e5b6 100644
--- a/ui/litellm-dashboard/src/components/templates/key_edit_view.tsx
+++ b/ui/litellm-dashboard/src/components/templates/key_edit_view.tsx
@@ -4,8 +4,10 @@ import { useProjects } from "@/app/(dashboard)/hooks/projects/useProjects";
import { useUISettings } from "@/app/(dashboard)/hooks/uiSettings/useUISettings";
import PolicySelector from "@/components/policies/PolicySelector";
import { InfoCircleOutlined } from "@ant-design/icons";
-import { TextInput, Button as TremorButton } from "@tremor/react";
-import { Form, Input, Select, Switch, Tooltip } from "antd";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner";
+import { Form, Input as AntdInput, Select, Switch, Tooltip } from "antd";
import { useEffect, useRef, useState } from "react";
import { hasCapability } from "../../utils/capabilities";
import { isProxyAdminRole, rolesWithWriteAccess } from "../../utils/roles";
@@ -306,7 +308,7 @@ export function KeyEditView({
return (
<Form form={form} onFinish={handleSubmit} initialValues={initialValues} layout="vertical">
<Form.Item label="Key Alias" name="key_alias">
- <TextInput />
+ <Input />
</Form.Item>
<Form.Item label="Models" name="models">
@@ -448,7 +450,7 @@ export function KeyEditView({
}
name="allowed_routes"
>
- <Input placeholder="Enter allowed routes (comma-separated). Special values: llm_api_routes, management_routes. Examples: llm_api_routes, /chat/completions, /keys/*. Leave empty to allow all routes" />
+ <AntdInput placeholder="Enter allowed routes (comma-separated). Special values: llm_api_routes, management_routes. Examples: llm_api_routes, /chat/completions, /keys/*. Leave empty to allow all routes" />
</Form.Item>
<Form.Item label="Max Budget (USD)" name="max_budget">
@@ -540,11 +542,11 @@ export function KeyEditView({
</Form.Item>
<Form.Item label="Model TPM Limit" name="model_tpm_limit">
- <Input.TextArea rows={4} placeholder='{"gpt-4": 100, "claude-v1": 200}' />
+ <AntdInput.TextArea rows={4} placeholder='{"gpt-4": 100, "claude-v1": 200}' />
</Form.Item>
<Form.Item label="Model RPM Limit" name="model_rpm_limit">
- <Input.TextArea rows={4} placeholder='{"gpt-4": 100, "claude-v1": 200}' />
+ <AntdInput.TextArea rows={4} placeholder='{"gpt-4": 100, "claude-v1": 200}' />
</Form.Item>
<Form.Item
@@ -562,7 +564,7 @@ export function KeyEditView({
tooltip={estimateTooltip.perModel}
rules={[estimateRules.perModel]}
>
- <Input.TextArea rows={4} placeholder='{"gpt-4": 4096}' disabled={!canEditEstimates} />
+ <AntdInput.TextArea rows={4} placeholder='{"gpt-4": 4096}' disabled={!canEditEstimates} />
</Form.Item>
<Form.Item
@@ -716,7 +718,7 @@ export function KeyEditView({
{/* Hidden field to register mcp_tool_permissions with the form */}
<Form.Item name="mcp_tool_permissions" initialValue={{}} hidden>
- <Input type="hidden" />
+ <AntdInput type="hidden" />
</Form.Item>
<Form.Item
@@ -811,7 +813,7 @@ export function KeyEditView({
</Form.Item>
{enableProjectsUI && hasProject && (
<Form.Item label="Project">
- <Input value={projectDisplay ?? ""} disabled />
+ <AntdInput value={projectDisplay ?? ""} disabled />
</Form.Item>
)}
<Form.Item label="Router Settings">
@@ -839,7 +841,7 @@ export function KeyEditView({
</Form.Item>
<Form.Item label="Metadata" name="metadata">
- <Input.TextArea rows={10} />
+ <AntdInput.TextArea rows={10} />
</Form.Item>
{/* Auto-Rotation Settings */}
@@ -858,30 +860,31 @@ export function KeyEditView({
{/* Hidden form field for token */}
<Form.Item name="token" hidden>
- <Input />
+ <AntdInput />
</Form.Item>
{/* Hidden form field for disabled callbacks */}
<Form.Item name="disabled_callbacks" hidden>
- <Input />
+ <AntdInput />
</Form.Item>
{/* Hidden form fields for auto-rotation */}
<Form.Item name="auto_rotate" hidden>
- <Input />
+ <AntdInput />
</Form.Item>
<Form.Item name="rotation_interval" hidden>
- <Input />
+ <AntdInput />
</Form.Item>
<div className="sticky z-10 bg-white p-4 border-t border-gray-200 -bottom-6 -inset-x-6">
<div className="flex justify-end items-center gap-2">
- <TremorButton variant="secondary" onClick={onCancel} disabled={isKeySaving}>
+ <Button variant="secondary" onClick={onCancel} disabled={isKeySaving}>
Cancel
- </TremorButton>
- <TremorButton type="submit" loading={isKeySaving}>
+ </Button>
+ <Button type="submit" disabled={isKeySaving} aria-busy={isKeySaving}>
+ {isKeySaving && <UiLoadingSpinner className="size-4" />}
Save Changes
- </TremorButton>
+ </Button>
</div>
</div>
</Form>