{{ m.last_seen_at or "-" }}{% if m.last_seen_ip %} from {{ m.last_seen_ip }}{% endif %}
Last flashed
{{ m.last_flashed_at or "-" }}
Last task
{% if m.last_task_status %}
{# Badge mapping: running=info (in flight), completed=
success (rc=0), cancelled=warning (operator abort),
failed=danger (rc!=0 / timeout). Same vocabulary as
the other manager-driven jobs (hashes, downloads,
release-fetches). #}
{% set badge_map = {
'running': 'bg-info',
'completed': 'bg-success',
'cancelled': 'bg-warning text-dark',
'failed': 'bg-danger',
} %}
{% set badge = badge_map.get(m.last_task_status, 'bg-light text-dark border') %}
{{ m.last_task_status }}
at {{ m.last_task_run_at }}
{% if m.last_task_output_path %}
output: {{ m.last_task_output_path }}
{% endif %}
{# Cancel button when a task is in flight. Hits
``DELETE /tasks/{mac}``; the manager's cancel()
sets the per-task threading.Event and SIGTERMs
the cijoe subprocess. #}
{% if m.last_task_status == 'running' %}
{% endif %}
{% else %}
-
{% endif %}
Created
{{ m.created_at }}
Updated
{{ m.updated_at }}
Assignment
{# Per-MAC event slice. Filtered to ``subject_kind=machine`` +
``subject_id=this MAC`` server-side; the link forwards the
same filter to /ui/events for drill-down. #}
{% with events=machine_events,
title="Recent activity for this machine",
link_to_full="/ui/events?subject_kind=machine&subject_id=" + m.mac %}
{% include "ui/_events_card.html" %}
{% endwith %}
{% endblock %}