diff --git a/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.tsx b/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.tsx index d3b009599d..ca0d8f67b7 100644 --- a/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.tsx +++ b/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.tsx @@ -1,9 +1,8 @@ import React from "react"; -import { Form, Switch, Select, Typography, Tooltip } from "antd"; +import { Select, Tooltip, Divider, Switch } from "antd"; import { InfoCircleOutlined } from "@ant-design/icons"; import { TextInput } from "@tremor/react"; -const { Text } = Typography; const { Option } = Select; interface KeyLifecycleSettingsProps { @@ -22,67 +21,75 @@ const KeyLifecycleSettings: React.FC = ({ onRotationIntervalChange, }) => { return ( -
- - Expire Key{' '} - - - - - } - name="duration" - className="mb-4" - > - - +
+ {/* Key Expiry Section */} +
+ Key Expiry Settings -
-
-
- Enable Auto-Rotation - - +
+
- +
+
- {autoRotationEnabled && ( -
- - Rotation Interval{' '} - - - - - } - name="rotation_interval" - className="mb-2" - > + + + {/* Auto-Rotation Section */} +
+ Auto-Rotation Settings + +
+
+ + +
+ + {autoRotationEnabled && ( +
+ - - - - When rotation occurs, you'll receive a notification with the new key. The old key will be deactivated after a brief grace period. - +
+ )} +
+ + {autoRotationEnabled && ( +
+ When rotation occurs, you'll receive a notification with the new key. The old key will be deactivated after a brief grace period.
)}
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 df9e30d252..c74511e6c0 100644 --- a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx +++ b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx @@ -335,6 +335,11 @@ const CreateKey: React.FC = ({ rotation_interval: rotationInterval }; } + + // Handle duration field for key expiry + if (formValues.duration) { + formValues.duration = formValues.duration; + } // Update the formValues with the final metadata formValues.metadata = JSON.stringify(metadata); @@ -1058,7 +1063,7 @@ const CreateKey: React.FC = ({ - Key Expiry & Auto-Rotation + Key Lifecycle