From 6e6537367f4852198276e8af2dbba94d04416485 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 20 Apr 2024 17:40:53 -0700 Subject: [PATCH] ui - fix create key flow --- .../src/components/create_key_button.tsx | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/ui/litellm-dashboard/src/components/create_key_button.tsx b/ui/litellm-dashboard/src/components/create_key_button.tsx index d8716d304..d950c3be5 100644 --- a/ui/litellm-dashboard/src/components/create_key_button.tsx +++ b/ui/litellm-dashboard/src/components/create_key_button.tsx @@ -147,6 +147,17 @@ const CreateKey: React.FC = ({ mode="multiple" placeholder="Select models" style={{ width: "100%" }} + onChange={(values) => { + // Check if "All Team Models" is selected + const isAllTeamModelsSelected = values.includes("all-team-models"); + + // If "All Team Models" is selected, deselect all other models + if (isAllTeamModelsSelected) { + const newValues = ["all-team-models"]; + // You can call the form's setFieldsValue method to update the value + form.setFieldsValue({ models: newValues }); + } + }} >