diff --git a/Server/API/AlertsController.cs b/Server/API/AlertsController.cs index d25610846..92cd36397 100644 --- a/Server/API/AlertsController.cs +++ b/Server/API/AlertsController.cs @@ -29,7 +29,6 @@ public AlertsController(DataService dataService, IEmailSenderEx emailSender) private IEmailSenderEx EmailSender { get; } [HttpPost("Create")] - [ServiceFilter(typeof(ApiAuthorizationFilter))] public async Task Create(AlertOptions alertOptions) { Request.Headers.TryGetValue("OrganizationID", out var orgID); @@ -94,7 +93,6 @@ await EmailSender.SendEmailAsync(alertOptions.EmailTo, } [HttpPost("Delete/{alertID}")] - [ServiceFilter(typeof(ApiAuthorizationFilter))] public async Task Delete(string alertID) { Request.Headers.TryGetValue("OrganizationID", out var orgID); diff --git a/Server/Auth/ApiAuthorizationFilter.cs b/Server/Auth/ApiAuthorizationFilter.cs index 126bd99f0..dd861b6c7 100644 --- a/Server/Auth/ApiAuthorizationFilter.cs +++ b/Server/Auth/ApiAuthorizationFilter.cs @@ -35,6 +35,12 @@ public void OnAuthorization(AuthorizationFilterContext context) if (DataService.ValidateApiToken(apiToken, apiSecret, context.HttpContext.Request.Path, context.HttpContext.Connection.RemoteIpAddress.ToString())) { var orgID = DataService.GetApiToken(apiToken)?.OrganizationID; + + // In case the filter gets run twice. + if (context.HttpContext.Request.Headers.ContainsKey("OrganizationID")) + { + return; + } context.HttpContext.Request.Headers.Add("OrganizationID", orgID); return; } diff --git a/Server/Pages/EditDevice.cshtml b/Server/Pages/EditDevice.cshtml index 57c5d6bbd..8a7aa795f 100644 --- a/Server/Pages/EditDevice.cshtml +++ b/Server/Pages/EditDevice.cshtml @@ -28,6 +28,12 @@ else +
+ +
+ +
+
diff --git a/Server/Pages/EditDevice.cshtml.cs b/Server/Pages/EditDevice.cshtml.cs index 24a1aec3e..28ae8ddbc 100644 --- a/Server/Pages/EditDevice.cshtml.cs +++ b/Server/Pages/EditDevice.cshtml.cs @@ -22,6 +22,7 @@ public EditDeviceModel(DataService dataService) public string AgentVersion { get; set; } public List DeviceGroups { get; } = new List(); public string DeviceName { get; set; } + public string DeviceID { get; set; } [BindProperty] public InputModel Input { get; set; } = new InputModel(); @@ -68,6 +69,7 @@ private void PopulateViewModel(string deviceID) { var device = DataService.GetDevice(user.OrganizationID, deviceID); DeviceName = device?.DeviceName; + DeviceID = device?.ID; AgentVersion = device.AgentVersion; Input.Alias = device?.Alias; Input.DeviceGroupID = device?.DeviceGroupID; diff --git a/Server/Pages/Index.cshtml.cs b/Server/Pages/Index.cshtml.cs index c74708fce..d1a9c7a47 100644 --- a/Server/Pages/Index.cshtml.cs +++ b/Server/Pages/Index.cshtml.cs @@ -24,10 +24,10 @@ public IndexModel(DataService dataService, public string DefaultPrompt { get; set; } public List DeviceGroups { get; set; } = new List(); + public List Alerts { get; set; } = new List(); + private ApplicationConfig AppConfig { get; } private DataService DataService { get; } private SignInManager SignInManager { get; } - private ApplicationConfig AppConfig { get; } - public async Task OnGet() { if (User?.Identity?.IsAuthenticated == true) @@ -50,6 +50,12 @@ public async Task OnGet() { DeviceGroups.AddRange(groups.Select(x => new SelectListItem(x.Name, x.ID))); } + var alerts = DataService.GetAlerts(user.Id); + if (alerts.Any()) + { + Alerts.AddRange(alerts); + } + } else { diff --git a/Server/Pages/_IndexLoggedIn.cshtml b/Server/Pages/_IndexLoggedIn.cshtml index 5e833a9c7..f97370c02 100644 --- a/Server/Pages/_IndexLoggedIn.cshtml +++ b/Server/Pages/_IndexLoggedIn.cshtml @@ -1,5 +1,34 @@ @model IndexModel + + + +
+
+ +
+ +
+ @foreach (var alert in Model.Alerts) + { +
+
@alert.CreatedOn.ToString()
+
+ @if (!string.IsNullOrWhiteSpace(alert.Device?.DeviceName)) + { +
@alert.Device.DeviceName
+ } +

@alert.Message

+
+
+ } +
+ +
+
- -
diff --git a/Server/Services/DataService.cs b/Server/Services/DataService.cs index c4b6eca61..03fda1621 100644 --- a/Server/Services/DataService.cs +++ b/Server/Services/DataService.cs @@ -36,20 +36,27 @@ public DataService(ApplicationDbContext context, public async Task AddAlert(AlertOptions alertOptions, string organizationID) { - await RemotelyContext.Users + var users = RemotelyContext.Users .Include(x => x.Alerts) - .Where(x => x.OrganizationID == organizationID) - .ForEachAsync(x => { - var alert = new Alert() - { - CreatedOn = DateTimeOffset.Now, - DeviceID = alertOptions.AlertDeviceID, - Message = alertOptions.AlertMessage, - OrganizationID = organizationID - }; - x.Alerts.Add(alert); - }); + .Where(x => x.OrganizationID == organizationID); + + if (!string.IsNullOrWhiteSpace(alertOptions.AlertDeviceID)) + { + var filteredUserIDs = FilterUsersByDevicePermission(users.Select(x => x.Id), alertOptions.AlertDeviceID); + users = users.Where(x => filteredUserIDs.Contains(x.Id)); + } + await users.ForEachAsync(x => { + var alert = new Alert() + { + CreatedOn = DateTimeOffset.Now, + DeviceID = alertOptions.AlertDeviceID, + Message = alertOptions.AlertMessage, + OrganizationID = organizationID + }; + x.Alerts.Add(alert); + }); + await RemotelyContext.SaveChangesAsync(); } @@ -83,11 +90,6 @@ public bool AddDeviceGroup(string orgID, DeviceGroup deviceGroup, out string dev return true; } - public async Task GetAlert(string alertID) - { - return await RemotelyContext.Alerts.FirstOrDefaultAsync(x => x.ID == alertID); - } - public InviteLink AddInvite(string orgID, Invite invite) { invite.InvitedUser = invite.InvitedUser.ToLower(); @@ -485,6 +487,21 @@ public string[] FilterUsersByDevicePermission(IEnumerable userIDs, strin .ToArray(); } + public async Task GetAlert(string alertID) + { + return await RemotelyContext.Alerts + .Include(x => x.Device) + .Include(x => x.User) + .FirstOrDefaultAsync(x => x.ID == alertID); + } + + public IEnumerable GetAlerts(string userID) + { + return RemotelyContext.Alerts + .Include(x => x.Device) + .Include(x => x.User) + .Where(x => x.UserID == userID); + } public IEnumerable GetAllApiTokens(string userID) { var user = RemotelyContext.Users.FirstOrDefault(x => x.Id == userID); diff --git a/Server/wwwroot/css/Themes/cyborg.custom.css b/Server/wwwroot/css/Themes/cyborg.custom.css index b7a987d7d..8cdec1b74 100644 --- a/Server/wwwroot/css/Themes/cyborg.custom.css +++ b/Server/wwwroot/css/Themes/cyborg.custom.css @@ -112,7 +112,7 @@ button.navbar-toggler:hover { color: limegreen; } -.fa-times { +td .fa-times { color: red; } diff --git a/Server/wwwroot/css/Themes/yeti.custom.css b/Server/wwwroot/css/Themes/yeti.custom.css index 87b3d4270..a14d372d7 100644 --- a/Server/wwwroot/css/Themes/yeti.custom.css +++ b/Server/wwwroot/css/Themes/yeti.custom.css @@ -107,7 +107,7 @@ button.navbar-toggler:hover { color: forestgreen; } -.fa-times { +td .fa-times { color: red; } diff --git a/Server/wwwroot/css/site.css b/Server/wwwroot/css/site.css index 63fdc32bd..f617b4f02 100644 --- a/Server/wwwroot/css/site.css +++ b/Server/wwwroot/css/site.css @@ -236,6 +236,39 @@ span.label.code { margin-bottom: -5px; } + +#alertsButton { + position: absolute; + top: 75px; + right: 5px; + z-index: 2; + transition: .5s ease left; + user-select: none; +} + + +#alertsFrame { + position: absolute; + right: 0; + top: 0; + height: 100%; + width: 0; + overflow-x: hidden; + overflow-y: auto; + text-align: center; + opacity: 0; + z-index: 2; + transition: .5s ease all; +} + +#alertsFrame.open { + width: 350px; + opacity: 1; + transition: .5s ease all; +} + + + .float-message { position: fixed; top: 20px; diff --git a/Server/wwwroot/scripts/InputEventHandlers.js b/Server/wwwroot/scripts/InputEventHandlers.js index b0dc95282..ff27e8ec2 100644 --- a/Server/wwwroot/scripts/InputEventHandlers.js +++ b/Server/wwwroot/scripts/InputEventHandlers.js @@ -15,6 +15,7 @@ export function ApplyInputEventHandlers() { clickStartRemoteControlButton(); consoleTabSelected(); deviceGroupSelectChanged(); + clickAlertsButtons(); window.addEventListener("resize", ev => { PositionCommandCompletionWindow(); }); @@ -156,6 +157,14 @@ function consoleTabSelected() { UI.ConsoleFrame.scrollTop = UI.ConsoleFrame.scrollHeight; }); } +function clickAlertsButtons() { + UI.AlertsButton.addEventListener("click", ev => { + UI.AlertsFrame.classList.toggle("open"); + }); + UI.CloseAlertsButton.addEventListener("click", ev => { + UI.AlertsFrame.classList.toggle("open"); + }); +} function clickToggleAllDevices() { document.getElementById("toggleAllDevices").addEventListener("click", function (e) { DataGrid.ToggleSelectAll(); diff --git a/Server/wwwroot/scripts/InputEventHandlers.js.map b/Server/wwwroot/scripts/InputEventHandlers.js.map index 47457bbfd..5ee14ceb4 100644 --- a/Server/wwwroot/scripts/InputEventHandlers.js.map +++ b/Server/wwwroot/scripts/InputEventHandlers.js.map @@ -1 +1 @@ -{"version":3,"file":"InputEventHandlers.js","sourceRoot":"","sources":["InputEventHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACxG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,UAAU,uBAAuB;IACnC,eAAe,EAAE,CAAC;IAClB,sBAAsB,EAAE,CAAC;IACzB,sBAAsB,EAAE,CAAC;IACzB,oBAAoB,EAAE,CAAC;IACvB,qBAAqB,EAAE,CAAC;IACxB,6BAA6B,EAAE,CAAC;IAChC,kBAAkB,EAAE,CAAC;IACrB,wBAAwB,EAAE,CAAC;IAE3B,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE;QACnC,+BAA+B,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,uBAAuB,CAAC,CAAgB;IAC7C,IAAI,CAAC,CAAC,OAAO,EAAE;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,WAAW,E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Server/wwwroot/scripts/InputEventHandlers.ts +++ b/Server/wwwroot/scripts/InputEventHandlers.ts @@ -17,6 +17,7 @@ export function ApplyInputEventHandlers() { clickStartRemoteControlButton(); consoleTabSelected(); deviceGroupSelectChanged(); + clickAlertsButtons(); window.addEventListener("resize", ev => { PositionCommandCompletionWindow(); @@ -163,6 +164,14 @@ function consoleTabSelected() { UI.ConsoleFrame.scrollTop = UI.ConsoleFrame.scrollHeight; }); } +function clickAlertsButtons() { + UI.AlertsButton.addEventListener("click", ev => { + UI.AlertsFrame.classList.toggle("open"); + }); + UI.CloseAlertsButton.addEventListener("click", ev => { + UI.AlertsFrame.classList.toggle("open"); + }); +} function clickToggleAllDevices() { document.getElementById("toggleAllDevices").addEventListener("click", function (e) { DataGrid.ToggleSelectAll(); diff --git a/Server/wwwroot/scripts/UI.js b/Server/wwwroot/scripts/UI.js index 07ec0e4a9..7c486c951 100644 --- a/Server/wwwroot/scripts/UI.js +++ b/Server/wwwroot/scripts/UI.js @@ -16,6 +16,9 @@ export var ConsoleTab = document.getElementById("consoleTab"); export var ConsoleAlert = document.getElementById("consoleAlert"); export var DeviceGroupSelect = document.getElementById("deviceGroupSelect"); export var GridFilter = document.getElementById("gridFilter"); +export var AlertsButton = document.getElementById("alertsButton"); +export var CloseAlertsButton = document.getElementById("closeAlertsFrameButton"); +export var AlertsFrame = document.getElementById("alertsFrame"); export function PopupMessage(message) { var messageDiv = document.createElement("div"); messageDiv.classList.add("float-message"); diff --git a/Server/wwwroot/scripts/UI.js.map b/Server/wwwroot/scripts/UI.js.map index 9621c61b3..e50938638 100644 --- a/Server/wwwroot/scripts/UI.js.map +++ b/Server/wwwroot/scripts/UI.js.map @@ -1 +1 @@ -{"version":3,"file":"UI.js","sourceRoot":"","sources":["UI.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAG5C,MAAM,CAAC,IAAI,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,uBAAuB,C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CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO,KAAK,CAAC;KAChB;SACI;QACD,OAAO,IAAI,CAAC;KACf;AACL,CAAC"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/UI.ts b/Server/wwwroot/scripts/UI.ts index 598c4b90f..4659ef716 100644 --- a/Server/wwwroot/scripts/UI.ts +++ b/Server/wwwroot/scripts/UI.ts @@ -18,6 +18,9 @@ export var ConsoleTab = document.getElementById("consoleTab") as HTMLAnchorEleme export var ConsoleAlert = document.getElementById("consoleAlert") as HTMLAnchorElement; export var DeviceGroupSelect = document.getElementById("deviceGroupSelect") as HTMLSelectElement; export var GridFilter = document.getElementById("gridFilter") as HTMLInputElement; +export var AlertsButton = document.getElementById("alertsButton") as HTMLButtonElement; +export var CloseAlertsButton = document.getElementById("closeAlertsFrameButton") as HTMLButtonElement; +export var AlertsFrame = document.getElementById("alertsFrame") as HTMLDivElement; export function PopupMessage(message: string) { diff --git a/Tests/DataServiceTests.cs b/Tests/DataServiceTests.cs index 46fff2f8c..b88d46893 100644 --- a/Tests/DataServiceTests.cs +++ b/Tests/DataServiceTests.cs @@ -163,6 +163,12 @@ public async Task AddAlert() ShouldAlert = true }; await DataService.AddAlert(options, TestData.OrganizationID); + + var alerts = DataService.GetAlerts(TestData.Admin1.Id); + + var json = System.Text.Json.JsonSerializer.Serialize(options); + + Assert.AreEqual("Test Message", alerts.First().Message); } } }