(ui) link to slack docs to test soft limit budget alerts

This commit is contained in:
ishaan-jaff 2024-03-02 16:47:00 -08:00
parent ebaf2eef1f
commit 169b085e9c
2 changed files with 13 additions and 7 deletions

View file

@ -71,10 +71,8 @@ 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);
@ -198,9 +196,14 @@ const CreateKey: React.FC<CreateKeyProps> = ({
<Title className="mt-6">Budgets</Title>
<Text>Soft Limit Budget: ${softBudget}</Text>
<Button className="mt-3" onClick={sendSlackAlert}>
Test Alert
Test Slack Alert
</Button>
<Text className="mt-2">
(LiteLLM Docs -
<a href="https://docs.litellm.ai/docs/proxy/alerting" target="_blank" className="text-blue-500">
Set Up Slack Alerting)
</a>
</Text>
</div>
) : (
<Text>Key being created, this might take 30s</Text>