{% extends "base.html" %} {% block content %} {% set attribute_name = "reports" %} {% set methods = ["all"] %} {% set codes = ["all"] %} {% set reasons = ["all"] %} {% set countries = ["all"] %} {% set reasons_count = {} %} {% set codes_count = {} %} {% set countries_count = {} %} {% set methods_count = {} %} {% for report in reports %} {% if reasons_count.update({report["reason"]|string : reasons_count.get(report["reason"], 0) + 1}) %}{% endif %} {% if codes_count.update({report["status"]|string : codes_count.get(report["status"], 0) + 1}) %}{% endif %} {% if countries_count.update({report["country"]|string : codes_count.get(report["country"], 0) + 1}) %}{% endif %} {% if methods_count.update({report["method"]|string : methods_count.get(report["method"], 0) + 1}) %}{% endif %} {% if report["method"] not in methods %} {% if methods.append(report["method"]) %}{% endif %} {% endif %} {% if report["status"] not in codes %} {% if codes.append(report["status"]) %}{% endif %} {% endif %} {% if report["reason"] not in reasons %} {% if reasons.append(report["reason"]) %}{% endif %} {% endif %} {% if report["country"] not in countries %} {% if countries.append(report["country"]) %}{% endif %} {% endif %} {% endfor %} {% set top_reason = {"count": 0, "name": "unknown"} %} {% for key, value in reasons_count.items() %} {% if value|int > top_reason["count"]|int %} {% if top_reason.update({"count": value, "name" : key|string}) %}{% endif %} {% endif %} {% endfor %} {% set top_code = {"count": 0, "name": "unknown"} %} {% for key, value in codes_count.items() %} {% if value|int > top_code["count"]|int %} {% if top_code.update({ "count" : value|string, "name" : key}) %}{% endif %} {% endif %} {% endfor %} {% set top_country = {"count": 0, "name": "unknown"} %} {% for key, value in countries_count.items() %} {% if value|int > top_country["count"]|int %} {% if top_country.update({ "count" : value|string, "name" : key}) %}{% endif %} {% endif %} {% endfor %} {% set top_method = {"count": 0, "name": "unknown"} %} {% for key, value in methods_count.items() %} {% if value|int > top_method["count"]|int %} {% if top_method.update({ "count" : value|string, "name" : key}) %}{% endif %} {% endif %} {% endfor %} {% set total_report = reports|length %}
No reports found
{% if reports|length != 0 %} {% set infos = [ {"name" : "REPORTING TOTAL", "data" : total_report|string or "0"}, {"name" : "TOP METHOD", "data" : top_method['name']|string}, {"name" : "TOP REASON", "data" : top_reason['name']|string}, {"name" : "TOP COUNTRY", "data" : top_country['name']|string}, {"name" : "TOP STATUS CODE", "data" : top_code['name']|string}, ] %} {% include "card_info.html" %} {% set filters = [ { "type": "input", "name": "Search", "label": "search", "id": "keyword", "placeholder": "ip, url, date, data", "pattern": "(.*?)" }, { "type": "select", "name": "Country", "id": "country", "value": "all", "values": countries }, { "type": "select", "name": "Method", "id": "method", "value": "all", "values": methods }, { "type": "select", "name": "Status code", "id": "status", "value": "all", "values": codes }, { "type": "select", "name": "Reason", "id": "reason", "value": "all", "values": reasons } ] %} {% include "card_filter.html" %} {% include "filter_nomatch.html" %}
REPORTING LIST
{% set reports_header = [ { "name": "Date", "position": "col-span-1" }, { "name": "IP", "position": "col-span-1" }, { "name": "Country", "position": "col-span-1" }, { "name": "Method", "position": "col-span-1" }, { "name": "URL", "position": "col-span-2" }, { "name": "Code", "position": "col-span-1" }, { "name": "User agent", "position": "col-span-2" }, { "name": "Reason", "position": "col-span-1" }, { "name": "Data", "position": "col-span-2" } ] %} {% for header in reports_header %}

{{ header['name'] }}

{% endfor %}
    {% for report in reports %}
  • {{ report['date'] }}

    {{ report['ip'] }}

    {{ report['country'] }}

    {{ report["method"] }}

    {{ report['url'] }}

    {{ report["status"] }}

    {{ report["user_agent"] }}

    {{ report["reason"] }}

    {{ report["data"] }}

  • {% endfor %}
{% endif %} {% endblock content %}