refactor: use extractAddress() method for monitor address

Address review feedback from CommanderStorm to use the inherited
extractAddress() method instead of directly accessing monitorJSON["url"].
This properly handles different monitor types (ping, port, dns, etc.).
This commit is contained in:
mkdev11 2026-01-06 01:06:37 +02:00
parent 13b49bb417
commit 4cad39740e

View File

@ -80,11 +80,12 @@ class GoogleChat extends NotificationProvider {
});
}
// add monitor URL if available
if (monitorJSON && monitorJSON["url"]) {
// add monitor address if available
const address = this.extractAddress(monitorJSON);
if (address) {
sectionWidgets.push({
textParagraph: {
text: `<b>URL:</b>\n<a href="${monitorJSON["url"]}">${monitorJSON["url"]}</a>`,
text: `<b>Address:</b>\n${address}`,
},
});
}