Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix small issues on Joblist #3767

Merged
merged 8 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 48 additions & 53 deletions app/grandchallenge/algorithms/templates/algorithms/job_list_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,71 +46,66 @@
<split></split>

{{ object.comment }}
<split></split>

<div class="child-p-mb-0 text-left">
{{ object.rendered_result_text }}
</div>

<split></split>
<ul class="list-unstyled mb-0 text-left">
{% if object.error_message %}

<div class="modal"
id="errorInfoModal-{{ object.pk }}"
tabindex="-1"
role="dialog"
aria-labelledby="statusfoModalTitle"
aria-hidden="true"
>
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
Error Message
</h5>
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="text-left modal-body">
{{ object.error_message }}
</div>
<div class="modal-footer">
<a class="btn btn-primary" href="{{ object.get_absolute_url }}">
<i class="fa fa-info-circle mr-1"></i>View Result Details
</a>
</div>
{% if object.rendered_result_text %}
chrisvanrun marked this conversation as resolved.
Show resolved Hide resolved
<div class="modal"
id="renderedResultModal-{{ object.pk }}"
tabindex="-1"
role="dialog"
aria-labelledby="statusfoModalTitle"
aria-hidden="true"
>
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
Result
</h5>
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="text-left modal-body">
{{ object.rendered_result_text }}
</div>
<div class="modal-footer">
<a class="btn btn-primary" href="{{ object.get_absolute_url }}">
<i class="fa fa-info-circle mr-1"></i>View Result Details
</a>
</div>
</div>
</div>
</div>

<li>
<a href="#errorInfoModal-{{ object.pk }}"
data-toggle="modal"
data-target="#errorInfoModal-{{ object.pk }}"
class="text-decoration-none"
>
<div class="badge badge-danger">
<i class="fa fa-fw fa-eye"></i>
Error
</div>
<div class="badge badge-light">
{{ object.error_message | truncatechars:16 }}
</div>
</a>
</li>
{% endif %}

<a class="badge badge-primary"
href="#renderedResultModal-{{ object.pk }}"
data-toggle="modal"
data-target="#renderedResultModal-{{ object.pk }}"
>
<i class="fa fa-fw fa-eye"></i>
Result
</a>
{% else %}
<a class="badge badge-primary"
href="{% url 'algorithms:job-detail' slug=object.algorithm_image.algorithm.slug pk=object.pk %}"
title="View result details">
<i class="fa fa-fw fa-info-circle"></i>
Result
</a>
{% endif %}

<split></split>

<ul class="list-unstyled mb-0 text-left">
{% for civ in object.outputs.all|sort_civs %}
<li>
{% include "components/partials/civ.html" with object=civ display_inline=True only %}
</li>
{% empty %}
{% if not object.error_message %}
<span class="text-muted">Empty</span>
{% endif %}
<span class="text-muted">Empty</span>
{% endfor %}
</ul>
<split></split>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,92 @@
<span class="badge badge-{{ object.status_context }}" {% if not object.finished %}hx-get="{{ object.status_url }}" hx-trigger="load delay:30s" hx-swap="outerHTML"{% endif %}>
{% if object.animate %}
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
{% endif %}
{{ object.get_status_display }}{% if object.status == object.SUCCESS and object.stderr %},
with warnings{% endif %}
</span>
{% load log_filter %}

{% if object.status == object.SUCCESS and object.stderr %}
<div>
<div class="modal"
id="warningInfoModal-{{ object.pk }}"
tabindex="-1"
role="dialog"
aria-hidden="true"
>
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
Warnings on stderr
</h5>
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="text-left modal-body">
{{ object.stderr | user_error | truncatechars:1024 }}
</div>
<div class="modal-footer">
<a class="btn btn-primary" href="{{ object.get_absolute_url }}">
<i class="fa fa-info-circle mr-1"></i>View Result Details
</a>
</div>
</div>
</div>
</div>

<a href="#warningInfoModal-{{ object.pk }}"
data-toggle="modal"
data-target="#warningInfoModal-{{ object.pk }}"
class="badge badge-{{ object.status_context }}"
title="Click to see the warnings"
>
<i class="fa fa-fw fa-eye" aria-hidden="true"></i>
{{ object.get_status_display }}, with warnings
</a>
</div>
{% elif object.status == object.FAILURE and object.error_message %}
<div>
<div class="modal"
id="errorInfoModal-{{ object.pk }}"
tabindex="-1"
role="dialog"
aria-hidden="true"
>
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
Error Message
</h5>
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="text-left modal-body">
{{ object.error_message }}
</div>
<div class="modal-footer">
<a class="btn btn-primary" href="{{ object.get_absolute_url }}">
<i class="fa fa-info-circle mr-1"></i>View Result Details
</a>
</div>
</div>
</div>
</div>

<a href="#errorInfoModal-{{ object.pk }}"
data-toggle="modal"
data-target="#errorInfoModal-{{ object.pk }}"
class="badge badge-{{ object.status_context }}"
title="Click to see the error message"
>
<i class="fa fa-fw fa-eye" aria-hidden="true"></i>
{{ object.get_status_display }}, with errors
</a>
</div>
{% else %}
<span class="badge badge-{{ object.status_context }}">
{% if object.animate %}
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
{% endif %}
{{ object.get_status_display }}
</span>
{% endif %}
12 changes: 12 additions & 0 deletions app/grandchallenge/components/templatetags/log_filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django import template

from grandchallenge.components.backends.utils import (
user_error as component_user_error,
)

register = template.Library()


@register.filter
def user_error(arg):
return component_user_error(arg)
Loading