From ba56e988f5d747eb6ee571ed31881b4bf4274c52 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 29 Mar 2024 16:36:02 -0700 Subject: [PATCH] (ui) add all_models --- .../src/components/create_key_button.tsx | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/ui/litellm-dashboard/src/components/create_key_button.tsx b/ui/litellm-dashboard/src/components/create_key_button.tsx index 30fcc8432..17476232c 100644 --- a/ui/litellm-dashboard/src/components/create_key_button.tsx +++ b/ui/litellm-dashboard/src/components/create_key_button.tsx @@ -91,16 +91,17 @@ const CreateKey: React.FC = ({ } }; - const sendSlackAlert = async () => { - try { - console.log("Sending Slack alert..."); - const response = await slackBudgetAlertsHealthCheck(accessToken); - console.log("slackBudgetAlertsHealthCheck Response:", response); - console.log("Testing Slack alert successful"); - } catch (error) { - console.error("Error sending Slack alert:", error); + + const handleModelSelection = (selectedModels: string[]) => { + if (selectedModels.includes("all_models")) { + // Select all models except "All Models" + const allModelsExceptAll = team ? team.models : userModels; + form.setFieldsValue({ + models: allModelsExceptAll + }); } }; + const handleCopy = () => { @@ -153,8 +154,11 @@ const CreateKey: React.FC = ({ mode="multiple" placeholder="Select models" style={{ width: "100%" }} + onChange={(selectedModels) => handleModelSelection(selectedModels)} > - + {team && team.models ? ( team.models.map((model: string) => (