fix(notifications): use real server name in remote threshold alerts

Server CPU/Memory threshold notifications for remote servers always
showed "Server Name: Remote" instead of the actual server name, making
it impossible to tell which server triggered the alert when more than
one remote server is registered.

The remote branch of receiveNotification already fetches the matching
server row (looked up by its metrics token) but discarded it, hardcoding
ServerName to the literal "Remote". Use the fetched row's name instead,
falling back to "Remote" if it is somehow absent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
PixelPerfector
2026-07-10 17:51:34 +03:00
parent 2e867c5be1
commit e19dd43293
@@ -535,7 +535,7 @@ export const notificationRouter = createTRPCRouter({
}
organizationId = result?.[0]?.organizationId;
ServerName = "Remote";
ServerName = result?.[0]?.name ?? "Remote";
}
await sendServerThresholdNotifications(organizationId, {