1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-13 00:28:10 -05:00

add alert/notification functionality (for server connection events and messages)

This commit is contained in:
RaidMax
2022-06-11 11:34:00 -05:00
parent 3475da87bc
commit 5966541039
16 changed files with 579 additions and 21 deletions

View File

@ -20,6 +20,8 @@ namespace SharedLibraryCore
{
public class BaseController : Controller
{
protected readonly IAlertManager AlertManager;
/// <summary>
/// life span in months
/// </summary>
@ -34,6 +36,7 @@ namespace SharedLibraryCore
public BaseController(IManager manager)
{
AlertManager = manager.AlertManager;
Manager = manager;
Localization ??= Utilities.CurrentLocalization.LocalizationIndex;
AppConfig = Manager.GetApplicationSettings().Configuration();
@ -169,6 +172,7 @@ namespace SharedLibraryCore
ViewBag.ReportCount = Manager.GetServers().Sum(server =>
server.Reports.Count(report => DateTime.UtcNow - report.ReportedOn <= TimeSpan.FromHours(24)));
ViewBag.PermissionsSet = PermissionsSet;
ViewBag.Alerts = AlertManager.RetrieveAlerts(Client).ToList();
base.OnActionExecuting(context);
}