From 30a4f224eeb2ab0d7d4759a25c5ca987d2a5d839 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 29 Mar 2024 16:28:36 -0700 Subject: [PATCH 1/3] (feat) team add all models available --- ui/litellm-dashboard/src/components/teams.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ui/litellm-dashboard/src/components/teams.tsx b/ui/litellm-dashboard/src/components/teams.tsx index ed853d8d1b..992de26139 100644 --- a/ui/litellm-dashboard/src/components/teams.tsx +++ b/ui/litellm-dashboard/src/components/teams.tsx @@ -87,6 +87,17 @@ const Team: React.FC = ({ setIsDeleteModalOpen(true); }; + const handleModelSelection = (selectedModels: string[]) => { + if (selectedModels.includes("all_models")) { + // Select all models except "All Models" + const allModelsExceptAll = userModels.filter(model => model !== "all"); + form.setFieldsValue({ + models: allModelsExceptAll + }); + } + }; + + const confirmDelete = async () => { if (teamToDelete == null || teams == null || accessToken == null) { return; @@ -343,7 +354,11 @@ const Team: React.FC = ({ mode="multiple" placeholder="Select models" style={{ width: "100%" }} + onChange={(selectedModels) => handleModelSelection(selectedModels)} > + + All Models + {userModels.map((model) => ( {model} @@ -351,6 +366,7 @@ const Team: React.FC = ({ ))} + From ba56e988f5d747eb6ee571ed31881b4bf4274c52 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 29 Mar 2024 16:36:02 -0700 Subject: [PATCH 2/3] (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 30fcc84325..17476232c1 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) => (