{% extends 'base.html' %} {% block main %} <h2>TLS Reports</h2> {% for domain, rpts in reports.items() %} <section id="{{ domain }}"> {%- set count_s = ((rpts | map(attribute='stats') | unzip)[0] | unzip)[0] | sum %} {%- set count_f = ((rpts | map(attribute='stats') | unzip)[0] | unzip)[1] | sum %} <h3>{{ domain }}{% if count_s + count_f > 0%}: {{ (count_s / (count_s + count_f)) | int * 100 }}%{% endif %}</h3> <table> <thead> <tr> <th>Date</th> <th>Report ID</th> <th>Success Rate</th> <th>Actions</th> </tr> </thead> <tbody> {%- for report in rpts %} {%- set cs = report.stats | sum(attribute=0) %} {%- set cf = report.stats | sum(attribute=1) %} <tr class="report-{{ report.class }}"> <td class="report-date"><time datetime="{{ report.ts.isoformat('T', timespec='seconds') }}">{{ report.ts.isoformat(' ', timespec='seconds') }}</time></td> <td class="report-id">{{ report.report_id }}</td> <td class="report-stats"> {% if cs + cf == 0 %} 0 {% else %} {{ (cs / (cs + cf)) | int * 100 }}% ({{ cs + cf }}) {% endif %} </td> <td class="report-actions"> <a href="{{ baseurl }}/ui/report/{{ report.report_id | urlencode }}">View</a> <a href="{{ baseurl }}/ui/report/{{ report.report_id | urlencode }}/json">Download</a> </td> </tr> {% endfor %} </tbody> </table> </section> {% endfor %} {% endblock %}