From 84df0634f1f60f972cbd5612565f2bfea649da03 Mon Sep 17 00:00:00 2001 From: YutaSaito <36355491+uc4w6c@users.noreply.github.com> Date: Sun, 16 Nov 2025 10:55:13 +0900 Subject: [PATCH] fix: key never expires #16005 (#16692) --- .../common_components/KeyLifecycleSettings.tsx | 18 +++++++++++++++++- .../components/organisms/create_key_button.tsx | 3 +++ .../src/components/templates/key_edit_view.tsx | 5 ++++- 3 files changed, 24 insertions(+), 2 deletions(-) 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 */}