diff --git a/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.tsx b/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.tsx index 2e8c8542b9..8129f4314f 100644 --- a/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.tsx +++ b/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.tsx @@ -28,6 +28,7 @@ const KeyLifecycleSettings: React.FC = ({ const [showCustomInput, setShowCustomInput] = useState(isCustomInterval); const [customInterval, setCustomInterval] = useState(isCustomInterval ? rotationInterval : ""); + const [durationValue, setDurationValue] = useState(form?.getFieldValue?.("duration") || ""); const handleIntervalChange = (value: string) => { if (value === "custom") { @@ -45,6 +46,15 @@ const KeyLifecycleSettings: React.FC = ({ setCustomInterval(value); onRotationIntervalChange(value); }; + + const handleDurationChange = (value: string) => { + setDurationValue(value); + if (form && typeof form.setFieldValue === "function") { + form.setFieldValue("duration", value); + } else if (form && typeof form.setFieldsValue === "function") { + form.setFieldsValue({ duration: value }); + } + }; return (
{/* Key Expiry Section */} @@ -58,7 +68,13 @@ const KeyLifecycleSettings: React.FC = ({ - +
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 5d8bfc8c82..02837eb666 100644 --- a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx +++ b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx @@ -1150,6 +1150,9 @@ const CreateKey: React.FC = ({ /> + 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 caa9729d4e..756b50b3df 100644 --- a/ui/litellm-dashboard/src/components/templates/key_edit_view.tsx +++ b/ui/litellm-dashboard/src/components/templates/key_edit_view.tsx @@ -517,10 +517,13 @@ export function KeyEditView({ + {/* Hidden form field for token */}