forked from phoenix/litellm-mirror
(feat) test slack alerts
This commit is contained in:
parent
cbd0851257
commit
768c3d8491
2 changed files with 51 additions and 2 deletions
|
@ -12,7 +12,7 @@ import {
|
|||
Select,
|
||||
message,
|
||||
} from "antd";
|
||||
import { keyCreateCall } from "./networking";
|
||||
import { keyCreateCall, slackBudgetAlertsHealthCheck } from "./networking";
|
||||
|
||||
const { Option } = Select;
|
||||
|
||||
|
@ -68,6 +68,20 @@ const CreateKey: React.FC<CreateKeyProps> = ({
|
|||
}
|
||||
};
|
||||
|
||||
const sendSlackAlert = async () => {
|
||||
try {
|
||||
console.log("Sending Slack alert...");
|
||||
message.info("Sending Test Slack alert...");
|
||||
const response = await slackBudgetAlertsHealthCheck(accessToken);
|
||||
console.log("slackBudgetAlertsHealthCheck Response:", response);
|
||||
message.success("Test Slack Alert worked - check your Slack!");
|
||||
console.log("Testing Slack alert successful");
|
||||
} catch (error) {
|
||||
console.error("Error sending Slack alert:", error);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Button className="mx-auto" onClick={() => setIsModalVisible(true)}>
|
||||
|
@ -183,7 +197,7 @@ const CreateKey: React.FC<CreateKeyProps> = ({
|
|||
<Text>API Key: {apiKey}</Text>
|
||||
<Title className="mt-6">Budgets</Title>
|
||||
<Text>Soft Limit Budget: ${softBudget}</Text>
|
||||
<Button className="mt-3">
|
||||
<Button className="mt-3" onClick={sendSlackAlert}>
|
||||
Test Alert
|
||||
</Button>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue