diff --git a/var/www/modules/hiddenServices/Flask_hiddenServices.py b/var/www/modules/hiddenServices/Flask_hiddenServices.py index 0d4426f4..4389f4ce 100644 --- a/var/www/modules/hiddenServices/Flask_hiddenServices.py +++ b/var/www/modules/hiddenServices/Flask_hiddenServices.py @@ -222,7 +222,17 @@ def delete_auto_crawler(url): @hiddenServices.route("/crawlers/", methods=['GET']) def dashboard(): - return render_template("Crawler_dashboard.html") + crawler_metadata_onion = get_crawler_splash_status('onion') + crawler_metadata_regular = get_crawler_splash_status('regular') + + now = datetime.datetime.now() + date = now.strftime("%Y%m%d") + statDomains_onion = get_stats_last_crawled_domains('onion', date) + statDomains_regular = get_stats_last_crawled_domains('regular', date) + + return render_template("Crawler_dashboard.html", crawler_metadata_onion = crawler_metadata_onion, + crawler_metadata_regular=crawler_metadata_regular, + statDomains_onion=statDomains_onion, statDomains_regular=statDomains_regular) @hiddenServices.route("/hiddenServices/2", methods=['GET']) def hiddenServices_page_test(): @@ -482,6 +492,21 @@ def remove_auto_crawler(): delete_auto_crawler(url) return redirect(url_for('hiddenServices.auto_crawler', page=page)) +@hiddenServices.route("/crawlers/crawler_dashboard_json", methods=['GET']) +def crawler_dashboard_json(): + + crawler_metadata_onion = get_crawler_splash_status('onion') + crawler_metadata_regular = get_crawler_splash_status('regular') + + now = datetime.datetime.now() + date = now.strftime("%Y%m%d") + + statDomains_onion = get_stats_last_crawled_domains('onion', date) + statDomains_regular = get_stats_last_crawled_domains('regular', date) + + return jsonify({'statDomains_onion': statDomains_onion, 'statDomains_regular': statDomains_regular, + 'crawler_metadata_onion':crawler_metadata_onion, 'crawler_metadata_regular':crawler_metadata_regular}) + # # TODO: refractor @hiddenServices.route("/hiddenServices/last_crawled_domains_with_stats_json", methods=['GET']) def last_crawled_domains_with_stats_json(): diff --git a/var/www/modules/hiddenServices/templates/Crawler_dashboard.html b/var/www/modules/hiddenServices/templates/Crawler_dashboard.html index 1f27cc3d..91d300af 100644 --- a/var/www/modules/hiddenServices/templates/Crawler_dashboard.html +++ b/var/www/modules/hiddenServices/templates/Crawler_dashboard.html @@ -26,17 +26,81 @@
+
+
+
+
+
Onions Crawlers
+
+
+ {{ statDomains_onion['domains_up'] }} UP + {{ statDomains_onion['domains_down'] }} DOWN +
+
+ {{ statDomains_onion['total'] }} Crawled + {{ statDomains_onion['domains_queue'] }} Queue +
+
+
+
+ + + {% for crawler in crawler_metadata_onion %} + + + + + + {% endfor %} + +
+ {{crawler['crawler_info']}} + + {{crawler['crawling_domain']}} + + {{crawler['status_info']}} +
+
+
-
-
-						--------------
-
-
-
-						--------------
-
-					
+
+
+
+
+
Regular Crawlers
+
+
+ {{ statDomains_regular['domains_up'] }} UP + {{ statDomains_regular['domains_down'] }} DOWN +
+
+ {{ statDomains_regular['total'] }} Crawled + {{ statDomains_regular['domains_queue'] }} Queue +
+
+
+
+ + + {% for crawler in crawler_metadata_regular %} + + + + + + {% endfor %} + +
+ {{crawler['crawler_info']}} + + {{crawler['crawling_domain']}} + + {{crawler['status_info']}} +
+
+
+
@@ -47,8 +111,20 @@