From ed8ad7b945136ae3e8d849d0960c2bad686ea9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 7 Aug 2020 17:06:25 +0200 Subject: [PATCH] new: Waiting messages on scraping page. --- website/web/__init__.py | 4 +++- website/web/static/scrape.js | 3 +++ website/web/templates/scrape.html | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/website/web/__init__.py b/website/web/__init__.py index aee26f51..907190d5 100644 --- a/website/web/__init__.py +++ b/website/web/__init__.py @@ -62,7 +62,9 @@ app.jinja_env.globals.update(sizeof_fmt=sizeof_fmt) def http_status_description(code: int): - return http.client.responses[code] + if code in http.client.responses: + return http.client.responses[code] + return f'Invalid code: {code}' app.jinja_env.globals.update(http_status_description=http_status_description) diff --git a/website/web/static/scrape.js b/website/web/static/scrape.js index 572beb8c..df978f3d 100644 --- a/website/web/static/scrape.js +++ b/website/web/static/scrape.js @@ -27,4 +27,7 @@ $('select[name="browser"]').change(function(){ $('#btn-looking').click(function() { $('#btn-looking').html('Looking...').addClass('disabled'); + $('#long').fadeOut(0).delay(9000).fadeIn(100); + $('#too-long').fadeOut(0).delay(19000).fadeIn(100); + $('#way-too-long').fadeOut(0).delay(27000).fadeIn(100); }); diff --git a/website/web/templates/scrape.html b/website/web/templates/scrape.html index f36c682a..52869dd6 100644 --- a/website/web/templates/scrape.html +++ b/website/web/templates/scrape.html @@ -98,6 +98,9 @@
+ + +