mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 09:52:38 +02:00
💄 — Better display of results’ error details
This commit is contained in:
parent
0ed60508e9
commit
0058e05f15
4 changed files with 56 additions and 5 deletions
|
@ -8,6 +8,7 @@
|
|||
- ✨ — Add new check type: http-to-https (#61)
|
||||
- 👷 — Remove Unreleased section from CHANGELOG when publishing documentation
|
||||
- 🩹 — Severity of ssl-certificate-expiration’s errors is now UNKNOWN (#60)
|
||||
- 💄 — Better display of results’ error details
|
||||
|
||||
## 0.4.1
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ from passlib.context import CryptContext
|
|||
from sqlalchemy import func
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from argos.checks.base import Status
|
||||
from argos.schemas import Config
|
||||
from argos.server import queries
|
||||
from argos.server.models import Result, Task, User
|
||||
|
@ -190,7 +191,7 @@ async def get_result_view(
|
|||
"""Show the details of a result"""
|
||||
result = db.query(Result).get(result_id)
|
||||
return templates.TemplateResponse(
|
||||
"result.html", {"request": request, "result": result}
|
||||
"result.html", {"request": request, "result": result, "error": Status.ERROR}
|
||||
)
|
||||
|
||||
|
||||
|
@ -220,6 +221,7 @@ async def get_task_results_view(
|
|||
"results": results,
|
||||
"task": task,
|
||||
"description": description,
|
||||
"error": Status.ERROR,
|
||||
},
|
||||
)
|
||||
|
||||
|
|
|
@ -3,7 +3,11 @@
|
|||
{% block content %}
|
||||
<dl>
|
||||
<dt>Task</dt>
|
||||
<dd>{{ result.task }}</dd>
|
||||
<dd>
|
||||
<a href="{{ url_for('get_task_results_view', task_id=result.task.id) }}">
|
||||
{{ result.task }}
|
||||
</a>
|
||||
</dd>
|
||||
<dt>Submitted at</dt>
|
||||
<dd>{{ result.submitted_at }}</dd>
|
||||
<dt>Status</dt>
|
||||
|
@ -11,6 +15,26 @@
|
|||
<dt>Severity</dt>
|
||||
<dd>{{ result.severity }}</dd>
|
||||
<dt>Context</dt>
|
||||
<dd>{{ result.context }}</dd>
|
||||
<dd>
|
||||
{% if result.status != error %}
|
||||
{{ result.context }}
|
||||
{% else %}
|
||||
<dl>
|
||||
{% if result.context['error_message'] %}
|
||||
<dt>Error message</dt>
|
||||
<dd>{{ result.context['error_message'] }}</dd>
|
||||
{% endif %}
|
||||
<dt>Error type</dt>
|
||||
<dd>{{ result.context['error_type'] }}</dd>
|
||||
<dt>Error details</dt>
|
||||
<dd>
|
||||
<details>
|
||||
<summary>{{ result.context['error_details'] | truncate(120, False, '…') }} (click to expand)</summary>
|
||||
<pre><code>{{ result.context['error_details'] | replace('\n', '<br>') | safe }}</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
{% endif %}
|
||||
</dd>
|
||||
</dl>
|
||||
{% endblock content %}
|
||||
|
|
|
@ -14,10 +14,34 @@
|
|||
<tbody>
|
||||
{% for result in results %}
|
||||
<tr id="{{ result.id }}">
|
||||
<td>{{ result.submitted_at }}</td>
|
||||
<td>
|
||||
<a href="{{ url_for('get_result_view', result_id=result.id) }}" title="See details of result {{ result.id }}">
|
||||
{{ result.submitted_at }}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ result.status }}</td>
|
||||
<td>{{ result.severity }}</td>
|
||||
<td>{{ result.context }}</td>
|
||||
<td>
|
||||
{% if result.status != error %}
|
||||
{{ result.context }}
|
||||
{% else %}
|
||||
<dl>
|
||||
{% if result.context["error_message"] %}
|
||||
<dt>Error message</dt>
|
||||
<dd>{{ result.context["error_message"] }}</dd>
|
||||
{% endif %}
|
||||
<dt>Error type</dt>
|
||||
<dd>{{ result.context["error_type"] }}</dd>
|
||||
<dt>Error details</dt>
|
||||
<dd>
|
||||
<details>
|
||||
<summary>{{ result.context["error_details"] | truncate(120, False, "…") }} (click to expand)</summary>
|
||||
<pre><code>{{ result.context["error_details"] | replace("\n", "<br>") | safe }}</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in a new issue