{% from "_macros.html" import icon %} {# What is running on the far side, and what it has printed. EVERYTHING here came off somebody else's machine and is untrusted exactly as much as model output is: the command was written by a model, the log is whatever the command printed. Jinja autoescaping covers the lot, and the log is `
` rather than anything that could emit HTML -- services/markdown.py is
  the one path allowed to do that, and this is the last content that should be
  given it.

  Not polled. The chip beside the composer is what refreshes on a timer; this is
  fetched when somebody opens it and re-rendered when they press something,
  because reading a log is an SSH round trip per job and nobody is looking at
  most of them.
#}
{% if not jobs %}

Nothing is running.

{% else %}

Background jobs

{% for job in jobs %}
{# `tone`, not `status`: `done` covers exit 0 and exit 2 alike, and a green dot beside the "Failed, exit 2" below would be the dot contradicting the sentence. The words stay here; only the colour is decided in Python. #} {# The whole command in the title, a truncated one on screen. A command line is unbounded and this sits in a menu with a fixed width; CSS truncates, and the title is how you read the rest. #} {% if job.running %} {% endif %}

{% if job.running %} Running {% elif job.status == "killed" %} Stopped {% elif job.status == "lost" %} {# The far side has no record of it: the host rebooted, or /tmp was cleared. Said plainly rather than shown as a failure, because nothing failed -- we simply cannot say how it ended. #} No longer traceable {% elif job.exit_status %} Failed, exit {{ job.exit_status }} {% else %} Finished {% endif %} {% if job.started_at %}· started {{ job.started_at.strftime("%H:%M") }}{% endif %} {# Only ever on a finished job -- see JobView.duration for why a running one says nothing rather than saying something frozen. #} {% if job.duration %} · took {{ job.duration }}{% endif %}

{% if open_job == job.id %} {% if error %}

{{ error }}

{% else %}
{{ body or "Nothing printed yet." }}
{% endif %} {% endif %}
{% endfor %} {% endif %}