mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-09-28 04:34:53 +02:00
Order sub scan history and fixed widget
This commit is contained in:
+2
-2
@@ -86,7 +86,7 @@ class ListSubScans(APIView):
|
||||
response['status'] = False
|
||||
|
||||
if subdomain_id:
|
||||
subscans = SubScan.objects.filter(subdomain__id=subdomain_id)
|
||||
subscans = SubScan.objects.filter(subdomain__id=subdomain_id).order_by('-stop_scan_date')
|
||||
subscan_results = SubScanSerializer(subscans, many=True).data
|
||||
|
||||
if subscans:
|
||||
@@ -94,7 +94,7 @@ class ListSubScans(APIView):
|
||||
response['results'] = subscan_results
|
||||
|
||||
elif scan_history:
|
||||
subscans = SubScan.objects.filter(scan_history__id=scan_history)
|
||||
subscans = SubScan.objects.filter(scan_history__id=scan_history).order_by('-stop_scan_date')
|
||||
subscan_results = SubScanSerializer(subscans, many=True).data
|
||||
|
||||
if subscans:
|
||||
|
||||
@@ -1728,8 +1728,11 @@ function loadSubscanHistoryWidget(scan_history_id){
|
||||
return response.json();
|
||||
}).then(function(data) {
|
||||
console.log(data);
|
||||
$('#subscan_history_widget').empty();
|
||||
if (data['status']) {
|
||||
$('#subscan_history_widget').empty();
|
||||
$('#sub_scan_history_count').append(`
|
||||
<span class="badge badge-soft-primary me-1">${data['results'].length}</span>
|
||||
`)
|
||||
for (var result in data['results']) {
|
||||
|
||||
var result_obj = data['results'][result];
|
||||
@@ -1749,6 +1752,11 @@ function loadSubscanHistoryWidget(scan_history_id){
|
||||
bg_color = 'bg-soft-success';
|
||||
status_badge = '<span class="float-end badge bg-success">Task Completed</span>';
|
||||
}
|
||||
else if(result_obj.status == 1){
|
||||
color = 'primary';
|
||||
bg_color = 'bg-soft-primary';
|
||||
status_badge = '<span class="float-end badge bg-primary">Running</span>';
|
||||
}
|
||||
|
||||
$('#subscan_history_widget').append(`
|
||||
<div class="card border-${color} border mini-card">
|
||||
@@ -1770,5 +1778,16 @@ function loadSubscanHistoryWidget(scan_history_id){
|
||||
`);
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#sub_scan_history_count').append(`
|
||||
<span class="badge badge-soft-primary me-1">0</span>
|
||||
`)
|
||||
$('#subscan_history_widget').append(`
|
||||
<div class="alert alert-warning alert-dismissible fade show mt-2" role="alert">
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
No Subscans has been initiated for any subdomains. You can select individual subdomains and initiate subscans like Directory Fuzzing, Vulnerability Scan etc.
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -270,9 +270,9 @@ Scan Findings
|
||||
<div class="d-flex align-items-start mb-3">
|
||||
<div class="w-100">
|
||||
<h5 class="mt-0 mb-0 font-15">
|
||||
Sub Scan History for <span class="badge badge-soft-primary">{{history.domain.name}}</span>
|
||||
<span id="sub_scan_history_count"></span> Sub Scan History for <span class="badge badge-soft-primary">{{history.domain.name}}</span>
|
||||
</h5>
|
||||
<div data-simplebar style="max-height: 410px;" class="p-2">
|
||||
<div data-simplebar style="max-height: 510px;" class="p-2">
|
||||
<div id="subscan_history_widget">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user