Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

sfwebui: fix scan status badge

Brendan Coles57a9500625e0
diff --git a/dyn/scaninfo.tmpl b/dyn/scaninfo.tmpl
index 85b23900..84f1ecab 100644
--- a/dyn/scaninfo.tmpl
+++ b/dyn/scaninfo.tmpl
@@ -348,17 +348,18 @@
$('#ucounter').html(uniqueCount);
$('#tcounter').html(totalCount);
$('#scanstatusbadge').html(scanStatus);
+
+ var statusy = "";
if (scanStatus == "FINISHED") {
statusy = "alert-success";
- }
- if (scanStatus.indexOf("ABORT") >= 0) {
+ } else if (scanStatus.indexOf("ABORT") >= 0) {
statusy = "alert-warning";
- }
- if (scanStatus == "RUNNING" || scanStatus == "STARTED" || scanStatus == "STARTING" || scanStatus == "INITIALIZING") {
+ } else if (scanStatus == "CREATED" || scanStatus == "RUNNING" || scanStatus == "STARTED" || scanStatus == "STARTING" || scanStatus == "INITIALIZING") {
statusy = "alert-info";
- }
- if (scanStatus.indexOf("FAILED") >= 0) {
+ } else if (scanStatus.indexOf("FAILED") >= 0) {
statusy = "alert-danger";
+ } else {
+ statusy = "alert-info";
}
$('#scanstatusbadge').removeClass(["alert-info", "alert-warning", "alert-danger"]).addClass(statusy);
$('#status').html(scanStatus);
diff --git a/static/js/spiderfoot.scanlist.js b/static/js/spiderfoot.scanlist.js
index 9b642dea..cbc1be52 100644
--- a/static/js/spiderfoot.scanlist.js
+++ b/static/js/spiderfoot.scanlist.js
@@ -176,17 +176,19 @@
table += "<td>" + data[i][2] + "</td>";
table += "<td>" + data[i][3] + "</td>";
table += "<td>" + data[i][5] + "</td>";
+
+ var statusy = "";
+
if (data[i][6] == "FINISHED") {
statusy = "alert-success";
- }
- if (data[i][6].indexOf("ABORT") >= 0) {
+ } else if (data[i][6].indexOf("ABORT") >= 0) {
statusy = "alert-warning";
- }
- if (data[i][6] == "RUNNING" || data[i][6] == "STARTED" || data[i][6] == "STARTING" || data[i][6] == "INITIALIZING") {
+ } else if (data[i][6] == "CREATED" || data[i][6] == "RUNNING" || data[i][6] == "STARTED" || data[i][6] == "STARTING" || data[i][6] == "INITIALIZING") {
statusy = "alert-info";
- }
- if (data[i][6].indexOf("FAILED") >= 0) {
+ } else if (data[i][6].indexOf("FAILED") >= 0) {
statusy = "alert-danger";
+ } else {
+ statusy = "alert-info";
}
table += "<td class='text-center'><span class='badge " + statusy + "'>" + data[i][6] + "</span></td>";
table += "<td class='text-center'>" + data[i][7] + "</td>";