[#7] Refactor job report page to include all errors
This commit is contained in:
parent
bec31a611e
commit
ef2defbcf9
|
@ -0,0 +1,32 @@
|
|||
{#
|
||||
Displays a table with a summary of the most common errors for a job
|
||||
|
||||
error_summary - List of tuples with (message, count)
|
||||
|
||||
Example:
|
||||
|
||||
{% snippet 'snippets/job_error_summary.html', summary=c.job.object_error_summary %}
|
||||
|
||||
#}
|
||||
<table class="table table-striped table-bordered table-condensed harvest-error-summary">
|
||||
<colgroup>
|
||||
<col width="8">
|
||||
<col width="92">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="count">{{ _('Count') }}</th>
|
||||
<th>{{ _('Message') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for error in summary %}
|
||||
<tr>
|
||||
<td class="count">{{ error[1] }}</td>
|
||||
<td>{{ error[0] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
{% if c.job.status == 'Finished' %}
|
||||
|
||||
{% if c.job.error_summary|length == 0 %}
|
||||
{% if c.job.object_error_summary|length == 0 and c.job.gather_error_summary|length == 0 %}
|
||||
<h2>{{ _('Error Summary') }}</h2>
|
||||
<p class="empty">{{ _('No errors for this job') }}</p>
|
||||
{% else %}
|
||||
|
@ -22,66 +22,74 @@
|
|||
{{ _('Error Summary') }}
|
||||
<small>{{ _('Only the 20 most frequent errors are shown') }}</small>
|
||||
</h2>
|
||||
<table class="table table-striped table-bordered table-condensed harvest-error-summary">
|
||||
<colgroup>
|
||||
<col width="8">
|
||||
<col width="92">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="count">{{ _('Count') }}</th>
|
||||
<th>{{ _('Message') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for error in c.job.error_summary %}
|
||||
<tr>
|
||||
<td class="count">{{ error[1] }}</td>
|
||||
<td>{{ error[0] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% if c.job.gather_error_summary|length > 0 %}
|
||||
<h3>{{ _('Job Errors') }}</h3>
|
||||
{% snippet 'snippets/job_error_summary.html', summary=c.job.gather_error_summary %}
|
||||
{% endif %}
|
||||
{% if c.job.object_error_summary|length > 0 %}
|
||||
<h3>{{ _('Document Errors') }}</h3>
|
||||
{% snippet 'snippets/job_error_summary.html', summary=c.job.object_error_summary %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if c.job.error_summary|length %}
|
||||
{% if c.job_report.gather_errors|length > 0 or c.job_report.object_errors.keys()|length > 0 %}
|
||||
<h2>
|
||||
{{ _('Error Report') }}
|
||||
<small>{{ c.job_report.keys()|length}} {{ _('documents with errors') }}</small>
|
||||
</h2>
|
||||
{% if c.job_report.gather_errors|length > 0 %}
|
||||
<h3>{{ _('Job Errors') }}</h3>
|
||||
<table class="table table-bordered table-hover harvest-error-list">
|
||||
<tbody>
|
||||
{% for error in c.job_report.gather_errors %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="error">
|
||||
{{ error.message }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
<table class="table table-bordered table-hover harvest-error-list">
|
||||
<tbody>
|
||||
{% for harvest_object_id in c.job_report.keys() %}
|
||||
<tr>
|
||||
<td>
|
||||
<span class="btn-group pull-right">
|
||||
{% if 'original_url' in c.job_report[harvest_object_id] %}
|
||||
<a href="{{ c.job_report[harvest_object_id].original_url }}" class="btn btn-small">
|
||||
{{ _('Remote content') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="{{ h.url_for('harvest_object_show', id=harvest_object_id) }}" class="btn btn-small">
|
||||
{{ _('Local content') }}
|
||||
</a>
|
||||
|
||||
</span>
|
||||
<h5>{{ c.job_report[harvest_object_id].guid }}</h5>
|
||||
{% for error in c.job_report[harvest_object_id].errors %}
|
||||
<div class="error">
|
||||
{{ error.message }}
|
||||
{% if error.line %}
|
||||
<span class="line">(line {{ error.line }})</span>
|
||||
{% if c.job_report.object_errors.keys()|length > 0 %}
|
||||
<h3>{{ _('Document Errors') }}
|
||||
<small>{{ c.job_report.object_errors.keys()|length}} {{ _('documents with errors') }}</small>
|
||||
</h3>
|
||||
<table class="table table-bordered table-hover harvest-error-list">
|
||||
<tbody>
|
||||
{% for harvest_object_id in c.job_report.object_errors.keys() %}
|
||||
{% set object = c.job_report.object_errors[harvest_object_id] %}
|
||||
<tr>
|
||||
<td>
|
||||
<span class="btn-group pull-right">
|
||||
{% if 'original_url' in object%}
|
||||
<a href="{{ object.original_url }}" class="btn btn-small">
|
||||
{{ _('Remote content') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
<a href="{{ h.url_for('harvest_object_show', id=harvest_object_id) }}" class="btn btn-small">
|
||||
{{ _('Local content') }}
|
||||
</a>
|
||||
|
||||
</span>
|
||||
<h5>{{ object.guid }}</h5>
|
||||
{% for error in object.errors %}
|
||||
<div class="error">
|
||||
{{ error.message }}
|
||||
{% if error.line %}
|
||||
<span class="line">(line {{ error.line }})</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue