forked from phoenix/litellm-mirror
(UI) fix - allow editing key alias on Admin UI (#6776)
* fix allow editing key alias on UI * fix non type for budget duration
This commit is contained in:
parent
4ed270506a
commit
bb16abc043
2 changed files with 13 additions and 5 deletions
|
@ -288,9 +288,13 @@ def prepare_key_update_data(
|
||||||
non_default_values["expires"] = expires
|
non_default_values["expires"] = expires
|
||||||
|
|
||||||
if "budget_duration" in non_default_values:
|
if "budget_duration" in non_default_values:
|
||||||
duration_s = _duration_in_seconds(
|
budget_duration = non_default_values.pop("budget_duration")
|
||||||
duration=non_default_values["budget_duration"]
|
if (
|
||||||
)
|
budget_duration
|
||||||
|
and (isinstance(budget_duration, str))
|
||||||
|
and len(budget_duration) > 0
|
||||||
|
):
|
||||||
|
duration_s = _duration_in_seconds(duration=budget_duration)
|
||||||
key_reset_at = datetime.now(timezone.utc) + timedelta(seconds=duration_s)
|
key_reset_at = datetime.now(timezone.utc) + timedelta(seconds=duration_s)
|
||||||
non_default_values["budget_reset_at"] = key_reset_at
|
non_default_values["budget_reset_at"] = key_reset_at
|
||||||
|
|
||||||
|
|
|
@ -291,6 +291,10 @@ const ViewKeyTable: React.FC<ViewKeyTableProps> = ({
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
|
|
||||||
|
<Form.Item name="key_alias" label="Key Alias">
|
||||||
|
<TextInput />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item label="Models" name="models" rules={[
|
<Form.Item label="Models" name="models" rules={[
|
||||||
{
|
{
|
||||||
validator: (rule, value) => {
|
validator: (rule, value) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue