{# docker/rows.html — HTMX fragment for the Docker main page, grouped by host #} {# ── Summary strip ─────────────────────────────────────────────────────────── #}
Running
{{ running }}
Stopped
{{ stopped }}
Total
{{ total }}
{% if swarm_services %}
Services
{{ swarm_services | length }}
{% endif %}
Hosts
{{ host_groups | length }}
{# ── Swarm services: collapsed per-service, each current replica labelled with its host (tasks Swarm replaced are left out). Ghost replicas (tasks on nodes with no Steward agent) come from the managers' placement data so the picture is cluster-complete. A failing service names Swarm's last task error. ───── #} {% if swarm_services %}
Swarm services Topology →
{% for s in swarm_services %}
{{ s.name }} {{ s.mode }} {{ s.running }}/{{ s.desired }} running
{% with style="padding-left:1.1rem;margin-bottom:0.35rem;" %}{% include "docker/_swarm_failures.html" %}{% endwith %}
{% for r in s.replicas %} {% if r.ghost %}
{{ r.host }} {{ r.count }} · no agent
{% else %}
{{ r.host }} {% if r.cpu_pct is not none %}{{ "%.0f" | format(r.cpu_pct) }}%{% endif %}
{% endif %} {% endfor %}
{% endfor %}
{% endif %} {# ── Container tables, one per host ───────────────────────────────────────── #} {% if host_groups %} {% for g in host_groups %}
{% if g.host %} {{ g.host.name }} {% else %} {{ g.host_name }} {% endif %} {{ g.running }} running{% if g.stopped %} · {{ g.stopped }} stopped{% endif %}
{% for sub in g.subgroups %} {% if g.grouped and sub.label %} {% endif %} {% for item in sub.containers %} {% set c = item.container %} {% endfor %} {% endfor %}
Container Image Ports CPU % CPU history Mem % Mem history
{{ sub.label }}
{{ c.name }} {% if c.health == 'healthy' %}● {% elif c.health == 'unhealthy' %}● {% elif c.health == 'starting' %}◐{% 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 %}
{{ c.image }} {% 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 %} {{ item.sparkline_cpu | safe }} {% if c.mem_pct is not none %} {{ "%.1f" | format(c.mem_pct) }}% {% else %} — {% endif %} {{ item.sparkline_mem | safe }}
{% endfor %} {% elif not swarm_services %}
No containers reported yet. Containers are collected by the Steward host agent — deploy the agent to a host running Docker (Hosts → the host → agent panel) and its containers will appear here under that host.
{% endif %}