mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
105 lines
4.7 KiB
HTML
105 lines
4.7 KiB
HTML
{% extends 'extras/report.html' %}
|
|
{% load helpers %}
|
|
{% load static %}
|
|
|
|
{% block title %}{{ report.name }} - {{ result.get_status_display }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<p>
|
|
Run: <strong>{{ result.created }}</strong>
|
|
{% if result.completed %}
|
|
Duration: <strong>{{ result.duration }}</strong>
|
|
{% else %}
|
|
<img id="pending-result-loader" src="{% static 'img/ajax-loader.gif' %}" />
|
|
{% endif %}
|
|
<span id="pending-result-label">{% include 'extras/inc/job_label.html' with result=result %}</span>
|
|
</p>
|
|
{% if result.completed %}
|
|
<div class="card">
|
|
<h5 class="card-header">
|
|
Report Methods
|
|
</h5>
|
|
<div class="card-body">
|
|
<table class="table table-hover">
|
|
{% for method, data in result.data.items %}
|
|
<tr>
|
|
<td><code><a href="#{{ method }}">{{ method }}</a></code></td>
|
|
<td class="text-right report-stats">
|
|
<label class="badge bg-success">{{ data.success }}</label>
|
|
<label class="badge bg-info">{{ data.info }}</label>
|
|
<label class="badge bg-warning">{{ data.warning }}</label>
|
|
<label class="badge bg-danger">{{ data.failure }}</label>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="card">
|
|
<h5 class="card-header">
|
|
Report Results
|
|
</h5>
|
|
<div class="card-body">
|
|
<table class="table table-hover report">
|
|
<thead>
|
|
<tr class="table-headings">
|
|
<th>Time</th>
|
|
<th>Level</th>
|
|
<th>Object</th>
|
|
<th>Message</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for method, data in result.data.items %}
|
|
<tr>
|
|
<th colspan="4" style="font-family: monospace">
|
|
<a name="{{ method }}"></a>{{ method }}
|
|
</th>
|
|
</tr>
|
|
{% for time, level, obj, url, message in data.log %}
|
|
<tr class="{% if level == 'failure' %}danger{% elif level %}{{ level }}{% endif %}">
|
|
<td>{{ time }}</td>
|
|
<td>
|
|
<label class="badge bg-{% if level == 'failure' %}danger{% else %}{{ level }}{% endif %}">{{ level|title }}</label>
|
|
</td>
|
|
<td>
|
|
{% if obj and url %}
|
|
<a href="{{ url }}">{{ obj }}</a>
|
|
{% elif obj %}
|
|
{{ obj }}
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ message }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<div class="well">Pending results</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block javascript %}
|
|
<script type="text/javascript">
|
|
{% if not result.completed %}
|
|
var pending_result_id = {{ result.pk }};
|
|
{% else %}
|
|
var pending_result_id = null;
|
|
{% endif %}
|
|
|
|
function jobTerminatedAction(){
|
|
refreshWindow();
|
|
}
|
|
|
|
</script>
|
|
<script src="{% static 'js/job_result.js' %}?v{{ settings.VERSION }}"
|
|
onerror="window.location='{% url 'media_failure' %}?filename=js/job_result.js'"></script>
|
|
{% endblock %}
|