[Ntfy] Only include action link if monitor url is defined #3274 (#4411)

This commit is contained in:
Frank Elsinga 2024-03-05 19:19:18 +01:00 committed by GitHub
commit da92400401
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,14 +54,17 @@ class Ntfy extends NotificationProvider {
"priority": priority, "priority": priority,
"title": monitorJSON.name + " " + status + " [Uptime-Kuma]", "title": monitorJSON.name + " " + status + " [Uptime-Kuma]",
"tags": tags, "tags": tags,
"actions": [ };
if (monitorJSON.url && monitorJSON.url !== "https://") {
data.actions = [
{ {
"action": "view", "action": "view",
"label": "Open " + monitorJSON.name, "label": "Open " + monitorJSON.name,
"url": monitorJSON.url, "url": monitorJSON.url,
},
];
} }
]
};
if (notification.ntfyIcon) { if (notification.ntfyIcon) {
data.icon = notification.ntfyIcon; data.icon = notification.ntfyIcon;