{% 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 %}
{{ header['name'] }}
{% endfor %}{{ report['date'] }}
{{ report['ip'] }}
{{ report['country'] }}
{{ report["method"] }}
{{ report['url'] }}
{{ report["status"] }}
{{ report["user_agent"] }}
{{ report["reason"] }}
{{ report["data"] }}