-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #297 from gavsto/dev
NEW FEATURE: Alerts (Alpha)
- Loading branch information
Showing
3 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<main> | ||
<header class="page-header page-header-compact page-header-light border-bottom bg-white mb-4"> | ||
<div class="container-xl px-4"> | ||
<div class="page-header-content"> | ||
<div class="row align-items-center justify-content-between pt-3"> | ||
<div class="col-auto mb-3"> | ||
<h1 class="page-header-title"> | ||
<div class="page-header-icon"><i data-feather="user-plus"></i></div> | ||
Alerts View | ||
</h1> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</header> | ||
<!-- Main page content--> | ||
<div class="container-fluid px-4"> | ||
<div class="row"> | ||
<div class="col-12"> | ||
<div class="card border-start-lg border-start-info h-100"> | ||
<div class="card-body"> | ||
<div class="d-flex align-items-center"> | ||
<div class="col-2 ps-2 border-start border-primary border-5"> | ||
<h3>New Alerts</h3> | ||
<h1 class="text-secondary" style="font-size:2rem;" id="NewAlerts"></h1> | ||
</div> | ||
<div class="col-2 ps-2 border-start border-primary border-5"> | ||
<h3>In Progress Alerts</h3> | ||
<h1 class="text-secondary" style="font-size:2rem;" id="InProgressAlerts"></h1> | ||
</div> | ||
<div class="col-2 ps-2 border-start border-primary border-5"> | ||
<h3>High Severity Alerts</h3> | ||
<h1 class="text-danger" style="font-size:2rem;" id="HighSeverityAlerts"></h1> | ||
</div> | ||
<div class="col-2 ps-2 border-start border-primary border-5"> | ||
<h3>Medium Severity Alerts</h3> | ||
<h1 class="text-warning" style="font-size:2rem;" id="MediumSeverityAlerts"></h1> | ||
</div> | ||
<div class="col-2 ps-2 border-start border-primary border-5"> | ||
<h3>Low Severity Alerts</h3> | ||
<h1 class="text-secondary" style="font-size:2rem;" id="LowSeverityAlerts"></h1> | ||
</div> | ||
<div class="col-2 ps-2 border-start border-primary border-5"> | ||
<h3>Informational Alerts</h3> | ||
<h1 class="text-secondary" style="font-size:2rem;" id="InformationalSeverityAlerts"></h1> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-12"> | ||
<!-- Alerts Here --> | ||
<div class="card border-start-lg border-start-info h-100"> | ||
<div class="card-body"> | ||
<div class="d-flex align-items-center"> | ||
<div class="flex-grow-1"> | ||
<div class="h2">Alerts</div> | ||
</div> | ||
<div class="ms-2"><i class="fas fa-key fa-2x text-gray-200"></i> | ||
</div> | ||
</div> | ||
<div class="d-flex align-items-center"> | ||
<div class="flex-grow-1"> | ||
<table class="table table-responsive" id="Passwords"> | ||
<thead> | ||
<tr> | ||
<th>Tenant</th> | ||
<th>Alert ID</th> | ||
<th>Alert Title</th> | ||
<th>Category</th> | ||
<th>Event Date</th> | ||
<th>Severity</th> | ||
<th>Status</th> | ||
</tr> | ||
</thead> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</main> | ||
<script src="js/ALERTSList.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
$(document).ready(function () { | ||
|
||
//This function keeps trying to get the data until the variable 'waiting' disappears. It repeats every 5 seconds to a maximum of 300 seconds. | ||
|
||
|
||
$.ajax({ | ||
'async': true, | ||
'global': false, | ||
'url': 'api/ExecAlertsList', | ||
'dataType': "json", | ||
'contentType': "application/json", | ||
'success': function (GUID) { | ||
//when succesfull, we get a GUID as a return. We use the GUID to get the actual data instead. | ||
GetAPIData("api/ExecAlertsList", GUID.GUID).then((data) => { | ||
console.log(data); | ||
//here we process the actual data returned by the GetAPIData feature! | ||
$('#loader').html(`<i class="fas fa-check-circle text-success fa-2x"></i>`) | ||
|
||
if (data.MSResults != "") { | ||
$("#NewAlerts").html(data.NewAlertsCount); | ||
$("#InProgressAlerts").html(data.InProgressAlertsCount); | ||
$("#HighSeverityAlerts").html(data.SeverityHighAlertsCount); | ||
$("#MediumSeverityAlerts").html(data.SeverityMediumAlertsCount); | ||
$("#LowSeverityAlerts").html(data.SeverityLowAlertsCount); | ||
$("#InformationalSeverityAlerts").html(data.SeverityInformationalCount); | ||
|
||
data.MSResults.forEach(function (item) { | ||
if (item.Id !== null) { | ||
$('#Passwords').append(`<tr><td>${item.Tenant}</td><td>${item.Id}</td><td>${item.Title}</td><td>${item.Category}</td><td>${item.EventDateTime}</td><td>${item.Severity}</td><td>${item.Status}</td></tr>`); | ||
} | ||
|
||
}); | ||
} else { | ||
$('#Passwords').append(`<tr><td>Something went WRONG!</td><td></td><td></td></tr>`); | ||
|
||
} | ||
}) | ||
}, | ||
'error': function (xhr, ajaxOptions, thrownError) { | ||
$("#loader").html('<i class="fas fa-times-circle text-danger fa-2x"></i>Error - could not retrieve information from API.') | ||
} | ||
}); | ||
}) |