forked from phoenix/litellm-mirror
(ui) add all_models
This commit is contained in:
parent
30a4f224ee
commit
ba56e988f5
1 changed files with 13 additions and 9 deletions
|
@ -91,18 +91,19 @@ const CreateKey: React.FC<CreateKeyProps> = ({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const sendSlackAlert = async () => {
|
|
||||||
try {
|
const handleModelSelection = (selectedModels: string[]) => {
|
||||||
console.log("Sending Slack alert...");
|
if (selectedModels.includes("all_models")) {
|
||||||
const response = await slackBudgetAlertsHealthCheck(accessToken);
|
// Select all models except "All Models"
|
||||||
console.log("slackBudgetAlertsHealthCheck Response:", response);
|
const allModelsExceptAll = team ? team.models : userModels;
|
||||||
console.log("Testing Slack alert successful");
|
form.setFieldsValue({
|
||||||
} catch (error) {
|
models: allModelsExceptAll
|
||||||
console.error("Error sending Slack alert:", error);
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleCopy = () => {
|
const handleCopy = () => {
|
||||||
message.success('API Key copied to clipboard');
|
message.success('API Key copied to clipboard');
|
||||||
};
|
};
|
||||||
|
@ -153,8 +154,11 @@ const CreateKey: React.FC<CreateKeyProps> = ({
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
placeholder="Select models"
|
placeholder="Select models"
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
|
onChange={(selectedModels) => handleModelSelection(selectedModels)}
|
||||||
>
|
>
|
||||||
|
<Option key="all_models" value="all_models">
|
||||||
|
All Models
|
||||||
|
</Option>
|
||||||
{team && team.models ? (
|
{team && team.models ? (
|
||||||
team.models.map((model: string) => (
|
team.models.map((model: string) => (
|
||||||
<Option key={model} value={model}>
|
<Option key={model} value={model}>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue