2017-09-21 16:32:05 -04:00
{% extends '_base.html' %}
{% load helpers %}
{% block content %}
2017-09-25 16:22:50 -04:00
< h1 > {% block title %}Reports{% endblock %}< / h1 >
2017-09-21 16:32:05 -04:00
< div class = "row" >
< div class = "col-md-9" >
2017-10-11 13:30:38 -04:00
{% if reports %}
2017-09-22 12:11:10 -04:00
{% for module, module_reports in reports %}
2017-10-11 13:30:38 -04:00
< h3 > < a name = "module.{{ module }}" > < / a > {{ module|bettertitle }}< / h3 >
< table class = "table table-hover table-headings reports" >
< thead >
2017-09-22 12:11:10 -04:00
< tr >
2017-10-11 13:30:38 -04:00
< th > Name< / th >
< th > Status< / th >
< th > Description< / th >
< th class = "text-right" > Last Run< / th >
2017-09-22 12:11:10 -04:00
< / tr >
2017-10-11 13:30:38 -04:00
< / thead >
< tbody >
{% for report in module_reports %}
2017-09-22 12:11:10 -04:00
< tr >
2017-10-11 13:30:38 -04:00
< td >
< a href = "{% url 'extras:report' name=report.full_name %}" name = "report.{{ report.name }}" > < strong > {{ report.name }}< / strong > < / a >
2017-09-26 17:17:28 -04:00
< / td >
2017-10-11 13:30:38 -04:00
< td >
2018-01-30 21:01:08 -05:00
{% include 'extras/inc/report_label.html' with result=report.result %}
2017-09-22 12:11:10 -04:00
< / td >
2017-10-11 13:30:38 -04:00
< td > {{ report.description|default:"" }}< / td >
{% if report.result %}
< td class = "text-right" > {{ report.result.created }}< / td >
{% else %}
< td class = "text-right text-muted" > Never< / td >
{% endif %}
2017-09-22 12:11:10 -04:00
< / tr >
2017-10-11 13:30:38 -04:00
{% for method, stats in report.result.data.items %}
< tr >
< td colspan = "3" class = "method" >
{{ method }}
< / td >
2018-07-23 16:10:46 -04:00
< td class = "text-right report-stats" >
2017-10-11 13:30:38 -04:00
< label class = "label label-success" > {{ stats.success }}< / label >
< label class = "label label-info" > {{ stats.info }}< / label >
< label class = "label label-warning" > {{ stats.warning }}< / label >
< label class = "label label-danger" > {{ stats.failure }}< / label >
< / td >
< / tr >
{% endfor %}
2017-09-22 12:11:10 -04:00
{% endfor %}
2017-10-11 13:30:38 -04:00
< / tbody >
< / table >
{% endfor %}
{% else %}
< div class = "alert alert-info" >
2017-10-11 14:03:35 -04:00
< p > < strong > No reports found.< / strong > < / p >
< p > Reports should be saved to < code > {{ settings.REPORTS_ROOT }}< / code > . (This path can be changed by setting < code > REPORTS_ROOT< / code > in NetBox's configuration.)< / p >
2017-10-11 13:30:38 -04:00
< / div >
{% endif %}
2017-09-21 16:32:05 -04:00
< / div >
2017-09-25 16:22:50 -04:00
< div class = "col-md-3" >
2017-10-11 13:30:38 -04:00
{% if reports %}
< div class = "panel panel-default" >
{% for module, module_reports in reports %}
< div class = "panel-heading" >
< strong > {{ module|bettertitle }}< / strong >
< / div >
< ul class = "list-group" >
{% for report in module_reports %}
< a href = "#report.{{ report.name }}" class = "list-group-item" >
< i class = "fa fa-list-alt" > < / i > {{ report.name }}
< div class = "pull-right" >
2018-07-20 09:39:55 -04:00
{% include 'extras/inc/report_label.html' with result=report.result %}
2017-10-11 13:30:38 -04:00
< / div >
< / a >
{% endfor %}
< / ul >
{% endfor %}
< / div >
{% endif %}
2017-09-25 16:22:50 -04:00
< / div >
2017-09-21 16:32:05 -04:00
< / div >
{% endblock %}