{% from "leeuwenhoek/_macros.html" import duration, time_ago, json_tree, retry_button, retry_of_link with context %} {#- A job entry is either a run (root of its own batch) or, with `dispatched`, the dispatch of a task recorded in the batch that dispatched it, linking to the run's batch. -#} {% macro state_tag(c) -%} {%- set cls = {'SUCCESS': 'is-success', 'FAILURE': 'is-danger', 'RETRY': 'is-warning', 'DISPATCHED': 'is-info'}.get(c.status, '') -%} {{ c.status | lower }} {%- endmacro %} {% macro job_link(c) -%} {%- if c.dispatched and c.job_batch_id %} View job{% endif -%} {%- endmacro %} {% macro head() %}
{{ c.name }}{{ e.content.name }} {{ state_tag(e.content) }} {{ duration(e.content.get('duration_ms')) }}{% endmacro %}
{% macro detail(e) %}
{% set c = e.content %}
Task
{{ c.name }}
Status
{{ state_tag(c) }}
Attempt
{{ c.attempt }}{% if c.max_retries is not none %} / {{ c.max_retries + 1 }}{% endif %}
Duration
{{ c.duration_ms | lw_duration }}
Queue
{{ c.queue or '—' }}
Task id {{ c.task_id }}
{%- if c.eager %} · eager{% endif %}
{%- if c.worker %} · worker {{ c.worker }}{% endif %}
{%- if c.eta %} · ETA {{ c.eta }}{% endif %}
{%- if c.dispatched and c.job_batch_id %} · View job{% endif %}
{%- if e.parent_batch_id and not c.dispatched %} · Dispatched by{% endif %}
{{- retry_of_link(e) }}