mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-23 03:33:53 +00:00
fix: address Discord webhook issues from #378
- Remove invalid url field from Discord embed (was causing 400 error) - Remove SVG avatar/footer icons (Discord doesn't support SVG) - Fix test webhook to use proper instance URL instead of 'pulse-monitoring' - Discord webhook template now sends valid payloads
This commit is contained in:
@@ -1125,7 +1125,7 @@ func (n *NotificationManager) SendTestWebhook(webhook WebhookConfig) error {
|
||||
ResourceID: "webhook-test",
|
||||
ResourceName: "Test Alert",
|
||||
Node: "test-node",
|
||||
Instance: "pulse-monitoring",
|
||||
Instance: "http://your-pulse-instance:7655", // Placeholder URL for test webhooks
|
||||
Message: fmt.Sprintf("This is a test alert from Pulse to verify your %s webhook is working correctly", webhook.Name),
|
||||
Value: 85.5,
|
||||
Threshold: 80.0,
|
||||
|
||||
@@ -22,11 +22,9 @@ func GetWebhookTemplates() []WebhookTemplate {
|
||||
Headers: map[string]string{"Content-Type": "application/json"},
|
||||
PayloadTemplate: `{
|
||||
"username": "Pulse Monitoring",
|
||||
"avatar_url": "https://raw.githubusercontent.com/rcourtman/Pulse/main/frontend-modern/public/logo.svg",
|
||||
"embeds": [{
|
||||
"title": "Pulse Alert: {{.Level | title}}",
|
||||
"description": "{{.Message}}",
|
||||
"url": "{{.Instance}}",
|
||||
"color": {{if eq .Level "critical"}}15158332{{else if eq .Level "warning"}}15105570{{else}}3447003{{end}},
|
||||
"fields": [
|
||||
{"name": "Resource", "value": "{{.ResourceName}}", "inline": true},
|
||||
@@ -38,8 +36,7 @@ func GetWebhookTemplates() []WebhookTemplate {
|
||||
],
|
||||
"timestamp": "{{.Timestamp}}",
|
||||
"footer": {
|
||||
"text": "Pulse Monitoring",
|
||||
"icon_url": "https://raw.githubusercontent.com/rcourtman/Pulse/main/frontend-modern/public/logo.svg"
|
||||
"text": "Pulse Monitoring"
|
||||
}
|
||||
}]
|
||||
}`,
|
||||
|
||||
Reference in New Issue
Block a user