diff --git a/instances/tests/test_detail_unreachable.py b/instances/tests/test_detail_unreachable.py index cc082f13..f3077d4e 100644 --- a/instances/tests/test_detail_unreachable.py +++ b/instances/tests/test_detail_unreachable.py @@ -36,6 +36,7 @@ class DetailOfUnreachableHostTests(TestCase): self.assertIn("far-vm", messages[0]) self.assertNotIn("far-host", messages[0]) self.assertNotIn("10.0.0.9", messages[0]) + self.assertIn("Jobs", messages[0]) def test_superuser_sees_the_host_and_its_error(self): admin = get_user_model().objects.create_superuser("far-admin", password="pw", email="far@example.com") diff --git a/instances/views.py b/instances/views.py index 7e178724..67cc8e91 100755 --- a/instances/views.py +++ b/instances/views.py @@ -102,7 +102,7 @@ def instance(request, pk): } else: msg = _("The host of '%(name)s' cannot be reached right now.") % {"name": instance.name} - messages.error(request, msg) + messages.error(request, msg + _(" Jobs on it can be followed under Jobs in the menu.")) return redirect(reverse("instances:index")) # The page only reads the VM, and its getters read the same XML some 30 # times: libvirt is asked once per kind of XML. diff --git a/operations/templates/operations/job.html b/operations/templates/operations/job.html new file mode 100644 index 00000000..564e923d --- /dev/null +++ b/operations/templates/operations/job.html @@ -0,0 +1,99 @@ +{% extends "base.html" %} +{% load i18n %} +{% load bootstrap_icons %} +{% load operations %} + +{% block title %}{{ job.label }}{% endblock %} + +{% block page_heading %}{{ job.label }}{% endblock page_heading %} + +{% block page_heading_extra %} +
{{ item }}| {% trans "Created" %} | +{% trans "Job" %} | +{% trans "State" %} | +{% trans "Resource" %} | + {% if request.user.is_superuser %}{% trans "User" %} | {% endif %} +
|---|---|---|---|---|
| {{ op.created_at|date:"M d H:i:s" }} | +
+ {{ row.label }}
+ {% if op.state in active_states and op.phase %}
+ {% translate op.phase %}
+ {% elif op.state == "failed" or op.state == "uncertain" %}
+ {{ op.error|truncatechars:80 }}
+ {% endif %}
+ {# below md the hidden columns show here #}
+ {{ row.resource_label|wrap_at_slash }}
+ {{ op.created_at|date:"M d H:i:s" }}{% if request.user.is_superuser %} · {{ row.username }}{% endif %} |
+ {% include "operations/state_badge.html" with state=op.state %} | +{{ row.resource_label|wrap_at_slash }} | + {% if request.user.is_superuser %}{{ row.username }} | {% endif %} +