report_list.html 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {% extends '_base.html' %}
  2. {% load helpers %}
  3. {% block content %}
  4. <h1>{% block title %}Reports{% endblock %}</h1>
  5. <div class="row">
  6. <div class="col-md-9">
  7. {% if reports %}
  8. {% for module, module_reports in reports %}
  9. <h3><a name="module.{{ module }}"></a>{{ module|bettertitle }}</h3>
  10. <table class="table table-hover table-headings reports">
  11. <thead>
  12. <tr>
  13. <th>Name</th>
  14. <th>Status</th>
  15. <th>Description</th>
  16. <th class="text-right">Last Run</th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. {% for report in module_reports %}
  21. <tr>
  22. <td>
  23. <a href="{% url 'extras:report' name=report.full_name %}" name="report.{{ report.name }}"><strong>{{ report.name }}</strong></a>
  24. </td>
  25. <td>
  26. {% include 'extras/inc/report_label.html' with result=report.result %}
  27. </td>
  28. <td>{{ report.description|default:"" }}</td>
  29. {% if report.result %}
  30. <td class="text-right">{{ report.result.created }}</td>
  31. {% else %}
  32. <td class="text-right text-muted">Never</td>
  33. {% endif %}
  34. </tr>
  35. {% for method, stats in report.result.data.items %}
  36. <tr>
  37. <td colspan="3" class="method">
  38. {{ method }}
  39. </td>
  40. <td class="text-right text-nowrap report-stats">
  41. <label class="label label-success">{{ stats.success }}</label>
  42. <label class="label label-info">{{ stats.info }}</label>
  43. <label class="label label-warning">{{ stats.warning }}</label>
  44. <label class="label label-danger">{{ stats.failure }}</label>
  45. </td>
  46. </tr>
  47. {% endfor %}
  48. {% endfor %}
  49. </tbody>
  50. </table>
  51. {% endfor %}
  52. {% else %}
  53. <div class="alert alert-info">
  54. <p><strong>No reports found.</strong></p>
  55. <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>
  56. </div>
  57. {% endif %}
  58. </div>
  59. <div class="col-md-3">
  60. {% if reports %}
  61. <div class="panel panel-default">
  62. {% for module, module_reports in reports %}
  63. <div class="panel-heading">
  64. <strong>{{ module|bettertitle }}</strong>
  65. </div>
  66. <ul class="list-group">
  67. {% for report in module_reports %}
  68. <a href="#report.{{ report.name }}" class="list-group-item">
  69. <i class="fa fa-list-alt"></i> {{ report.name }}
  70. <div class="pull-right">
  71. {% include 'extras/inc/report_label.html' with result=report.result %}
  72. </div>
  73. </a>
  74. {% endfor %}
  75. </ul>
  76. {% endfor %}
  77. </div>
  78. {% endif %}
  79. </div>
  80. </div>
  81. {% endblock %}