inject settings service, extract client host
This commit is contained in:
1 parent
412a3b7cc9
commit
a8ecd44abf
9 files changed
+73
-28
No files matched your search
@@ -27,7 +27,7 @@ export class MatrixProvider implements INotificationProvider {
|
||||
return buildWebhookBody(monitor, monitorStatusResponse);
|
||||
}
|
||||
// For threshold breaches, use hardware alert format
|
||||
const { alertsToSend } = buildHardwareAlerts("HOST_PLACEHOLDER", monitor, monitorStatusResponse);
|
||||
const { alertsToSend } = buildHardwareAlerts(clientHost, monitor, monitorStatusResponse);
|
||||
const body = buildHardwareNotificationMessage(clientHost, alertsToSend, monitor);
|
||||
return body;
|
||||
};
|
||||
@@ -37,12 +37,18 @@ export class MatrixProvider implements INotificationProvider {
|
||||
return body;
|
||||
};
|
||||
|
||||
sendAlert = async (notification: Notification, monitor: Monitor, monitorStatusResponse: MonitorStatusResponse, decision: MonitorActionDecision) => {
|
||||
sendAlert = async (
|
||||
notification: Notification,
|
||||
monitor: Monitor,
|
||||
monitorStatusResponse: MonitorStatusResponse,
|
||||
decision: MonitorActionDecision,
|
||||
clientHost: string
|
||||
) => {
|
||||
const { homeserverUrl, accessToken, roomId } = notification;
|
||||
|
||||
let content;
|
||||
if (monitor.type === "hardware") {
|
||||
content = this.getHardwareContent("HOST_PLACEHOLDER", monitor, monitorStatusResponse, decision);
|
||||
content = this.getHardwareContent(clientHost, monitor, monitorStatusResponse, decision);
|
||||
} else {
|
||||
content = this.getContent(monitor, monitorStatusResponse);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user