diff --git a/src/css/httpobs.css b/src/css/httpobs.css index 249c95b..62c1aa2 100644 --- a/src/css/httpobs.css +++ b/src/css/httpobs.css @@ -413,3 +413,7 @@ header { .text-prewrap { white-space: pre-wrap; } + +#scan-progress { + display: none; +} \ No newline at end of file diff --git a/src/js/index.js b/src/js/index.js index 9095593..d390f1d 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -92,6 +92,9 @@ const Observatory = { const successCallback = function f(data) { if (data.error !== undefined && data.error !== 'site down') { + $('#scan-box').css('display', 'block'); + $('#scan-progress').css('display', 'none'); + // if it's an IP address error, let them click through if (data.error === 'invalid-hostname-ip') { $('#scan-alert-ip-link').attr('href', window.location.href + 'analyze/' + url.host + '#ssh'); @@ -114,7 +117,7 @@ const Observatory = { } else { window.location.href = `/analyze/index.html?host=${url.host}&${thirdPartyOpt}`; } - + return true; }; @@ -126,6 +129,10 @@ const Observatory = { Observatories.TLS.load(rescan, true); } + $('#scan-box').css('display', 'none'); + $('#scan-progress-bar-text').text('Scan in progress'); + $('#scan-progress').css('display', 'block'); + Observatories.HTTP.submit(url.host, successCallback, Observatories.HTTP.displayError, 'POST', rescan, hidden); return false; diff --git a/src/js/observatories/http.js b/src/js/observatories/http.js index 82f29d7..5020866 100644 --- a/src/js/observatories/http.js +++ b/src/js/observatories/http.js @@ -38,6 +38,9 @@ const displayError = async (text, statusText) => { } } + $('#scan-box').css('display', 'block'); + $('#scan-progress').css('display', 'none'); + $('#scan-alert-text').text(error); $('#scan-alert').removeClass('alert-hidden'); utils.errorResults(error, 'scan'); diff --git a/src/templates/index.html b/src/templates/index.html index 96cb79d..bef472b 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -6,7 +6,10 @@