Add experimental server alerts and webhook notifications
Release rolling / release (push) Successful in 7m30s
Release rolling / release (push) Successful in 7m30s
Server-side alerting for Docker/container/stack health with Discord, Slack, Teams, ntfy, Gotify, Telegram, and generic webhooks. Settings tab, client cache, and backup/restore coverage; marked experimental.
This commit is contained in:
@@ -9488,6 +9488,35 @@ function handleRpcMessage(response, conn) {
|
||||
break;
|
||||
}
|
||||
|
||||
case 'alert': {
|
||||
// Server webhook alert also surfaces in the local bell
|
||||
const a = response.data || response;
|
||||
const sev = String(a.severity || 'info').toLowerCase();
|
||||
const type =
|
||||
sev === 'critical' || sev === 'error'
|
||||
? 'danger'
|
||||
: sev === 'warning'
|
||||
? 'warning'
|
||||
: 'info';
|
||||
try {
|
||||
notificationManager?.add?.(
|
||||
type,
|
||||
a.title
|
||||
? `${a.title}${a.message ? ' — ' + a.message : ''}`
|
||||
: a.message || 'Server alert',
|
||||
{ badge: sev === 'critical' || sev === 'warning', key: a.id || a.ruleId }
|
||||
);
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
try {
|
||||
window.peardockAlerts?.onServerAlert?.(a);
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 'systemDf':
|
||||
renderSystemDf(response.data);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user