{# docker/rows.html — HTMX fragment for the Docker main page, grouped by host #}
{# docker/rows.html — HTMX fragment for the Docker page: what needs attention
first (service.needs_attention, the ranking the MCP tools use), the counts,
then swarm services and each host's containers. #}
{% from "_macros.html" import stat_tile, status_badge, status_dot %}
{# ── Needs attention ──────────────────────────────────────────────────────── #}
{% if attention %}
Needs attention
{% for r in attention %}
{% set c = r.container %}
{% set worst = r.problems[0] %}
| Container | Image | Ports | CPU % | Mem % |
|---|---|---|---|---|
| {{ sub.label }} | ||||
|
{{ status_dot('stale' if item.stale else ('up' if c.status == 'running' else ('pending' if c.status == 'paused' else 'down')), 'Stale' if item.stale else c.status|capitalize) }}
{{ c.name }}
{% if c.health == 'unhealthy' %} {{ status_badge('crit', 'Unhealthy') }}
{% elif c.health == 'starting' %} {{ status_badge('pending', 'Starting') }}{% endif %}
{% if item.stale %} {{ status_badge('stale', title="Last report " ~ (c.scraped_at.strftime('%Y-%m-%d %H:%M UTC') if c.scraped_at else 'never') ~ "; what is shown may no longer be true") }}{% endif %}
{{ c.status }}{% if item.uptime %} · up {{ item.uptime }}{% endif %}
{% if c.status != 'running' and c.exit_code is not none and c.exit_code != 0 %}
· exit {{ c.exit_code }}{% if c.oom_killed %} (OOM){% endif %}
{% endif %}
{% if c.restart_count %} · ⟳{{ c.restart_count }}{% endif %}
{% if c.service_name or c.compose_project %}
{{ c.service_name or c.compose_project }}
{% endif %}
|
{% for p in item.ports %}
{{ p.host_port }}:{{ p.container_port }}/{{ p.protocol }}
{% endfor %}
|
{% if c.cpu_pct is not none %} {{ "%.1f" | format(c.cpu_pct) }}% {% else %} — {% endif %} | {% if c.mem_pct is not none %} {{ "%.1f" | format(c.mem_pct) }}% {% else %} — {% endif %} | |