Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Dashboard/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,29 @@ private async System.Threading.Tasks.Task CheckAllConnectionsAsync()
_notificationService?.ShowServerOfflineNotification(
item.DisplayName,
newStatus.ErrorMessage);

var errorDetail = newStatus.ErrorMessage ?? "Connection failed";
_emailAlertService.RecordAlert(item.Id, item.DisplayName, "Server Unreachable",
errorDetail, "Online", true, "email");
_ = _emailAlertService.TrySendAlertEmailAsync(
"Server Unreachable",
item.DisplayName,
errorDetail,
"Online",
item.Id);
}
else if (!wasOnline && isOnline && prefs.NotifyOnConnectionRestored)
{
_notificationService?.ShowConnectionRestoredNotification(item.DisplayName);

_emailAlertService.RecordAlert(item.Id, item.DisplayName, "Server Restored",
"Online", "Online", true, "email");
_ = _emailAlertService.TrySendAlertEmailAsync(
"Server Restored",
item.DisplayName,
"Connection restored",
"Online",
item.Id);
}
}

Expand Down
2 changes: 2 additions & 0 deletions Dashboard/Services/EmailTemplateBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ private static (string AccentColor, string BadgeText) GetSeverity(string metricN
"Long-Running Query" => ("#D97706", "WARNING"),
"TempDB Space" => ("#D97706", "WARNING"),
"Long-Running Job" => ("#D97706", "WARNING"),
"Server Unreachable" => ("#DC2626", "CRITICAL"),
"Server Restored" => ("#16A34A", "RESOLVED"),
_ => ("#2eaef1", "INFO")
};
}
Expand Down
Loading