From 02e1b4698dc21540f3c4df039bd5de6a6c9eb53f Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 5 Sep 2022 07:20:30 +0100 Subject: [PATCH] Don't add sources to query if we are allowed to see them all --- core/lib/manticore.py | 6 +- .../ui/drilldown/table_results_partial.html | 942 +++++++++--------- 2 files changed, 476 insertions(+), 472 deletions(-) diff --git a/core/lib/manticore.py b/core/lib/manticore.py index 86d689a..8d3dd76 100644 --- a/core/lib/manticore.py +++ b/core/lib/manticore.py @@ -162,9 +162,13 @@ def query_results( sources.append(source_iter) add_top_tmp = {"bool": {"should": []}} + total_count = 0 for source_iter in sources: add_top_tmp["bool"]["should"].append({"equals": {"src": source_iter}}) - add_top.append(add_top_tmp) + total_count += 1 + total_sources = len(settings.MANTICORE_MAIN_SOURCES) + len(settings.MANTICORE_SOURCES_RESTRICTED) + if not total_count == total_sources: + add_top.append(add_top_tmp) # Date/time range if set({"from_date", "to_date", "from_time", "to_time"}).issubset( diff --git a/core/templates/ui/drilldown/table_results_partial.html b/core/templates/ui/drilldown/table_results_partial.html index 0b72408..691ce11 100644 --- a/core/templates/ui/drilldown/table_results_partial.html +++ b/core/templates/ui/drilldown/table_results_partial.html @@ -4,485 +4,485 @@ {% load joinsep %} {% load urlsafe %} {% block table-wrapper %} -
- {% block table %} -
-
- -
-
- Static -
+
+ {% block table %} +
+
+ + {% endblock table.tfoot %} + +
+ {% endblock table %} + {% block pagination %} + {% if table.page and table.paginator.num_pages > 1 %} + + {% endif %} + {% endblock pagination %} +
{% endblock table-wrapper %} \ No newline at end of file