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 %} +
+
+ + + {% else %} +
+ {{ column.header }} +
+ {% endif %} +
+ + {% endblock table.thead.th %} + {% endif %} + + {% endfor %} + + {% endblock table.thead.row %} + {% endif %} - {% endblock pagination %} -
+ {% endblock table.thead %} + {% block table.tbody %} + + {% for row in table.paginated_rows %} + {% block table.tbody.row %} + {% if row.cells.type == 'control' %} + + + + + + + + +

Hidden {{ row.cells.hidden }} similar result{% if row.cells.hidden > 1%}s{% endif %}

+ + + + {% else %} + + {% for column, cell in row.items %} + {% if column.name in show %} + {% block table.tbody.td %} + {% if cell == '—' %} + + + + + + {% elif column.name == 'tokens' %} + + {{ cell|joinsep:',' }} + + {% elif column.name == 'src' %} + + + {% if row.cells.src == 'irc' %} + + + + {% elif row.cells.src == 'dis' %} + + + + {% elif row.cells.src == '4ch' %} + + + + {% endif %} + + + {% elif column.name == 'ts' %} + +

{{ row.cells.date }}

+

{{ row.cells.time }}

+ + {% elif column.name == 'type' or column.name == 'mtype' %} + + + {% if cell == 'msg' %} + + + + {% elif cell == 'join' %} + + + + {% elif cell == 'part' %} + + + + {% elif cell == 'quit' %} + + + + {% elif cell == 'kick' %} + + + + {% elif cell == 'nick' %} + + + + {% elif cell == 'mode' %} + + + + {% elif cell == 'action' %} + + + + {% elif cell == 'notice' %} + + + + {% elif cell == 'conn' %} + + + + {% elif cell == 'znc' %} + + + + {% elif cell == 'query' %} + + + + {% elif cell == 'highlight' %} + + + + {% elif cell == 'who' %} + + + + {% elif cell == 'topic' %} + + + + {% else %} + {{ cell }} + {% endif %} + + + {% elif column.name == 'msg' %} + + + {{ row.cells.msg }} + + + {% elif column.name == 'nick' %} + +
+
+ {% if row.cells.online is True %} + + + + {% elif row.cells.online is False %} + + + + {% else %} + + + + {% endif %} +
+ + {{ cell }} + +
+ {% if row.cells.src == 'irc' %} + + + + + + + + + + + + + + + + {% endif %} +
+ {% if row.cells.num_chans != '—' %} +
+ + {{ row.cells.num_chans }} + +
+ {% endif %} +
+ + {% elif column.name == 'channel' %} + + {% if cell != '—' %} +
+ + {{ cell }} + + {% if row.cells.num_users != '—' %} +
+ + {{ row.cells.num_users }} + +
+ {% endif %} +
+ {% else %} + {{ cell }} + {% endif %} + + {% elif cell is True or cell is False %} + + {% if cell is True %} + + + + {% else %} + + + + {% endif %} + + {% else %} + + + {{ cell }} + + + {% endif %} + {% endblock table.tbody.td %} + {% endif %} + {% endfor %} + + {% endif %} + {% endblock table.tbody.row %} + {% empty %} + {% if table.empty_text %} + {% block table.tbody.empty_text %} + {{ table.empty_text }} + {% endblock table.tbody.empty_text %} + {% endif %} + {% endfor %} + + {% endblock table.tbody %} + {% block table.tfoot %} + {% if table.has_footer %} + + {% block table.tfoot.row %} + + {% for column in table.columns %} + {% block table.tfoot.td %} + {{ column.footer }} + {% endblock table.tfoot.td %} + {% endfor %} + + {% endblock table.tfoot.row %} + + {% endif %} + {% 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