{# docker/widget.html — dashboard widget: what Docker is running and what has failed. Swarm services first, troubled ones at the top with since-times; then the containers outside any service, by host, problems first. The failed count links to the Docker page's list of exactly what it counts. #} {% from "docker/_usage.html" import cpu %} {% if total_count == 0 %}

No containers reported yet.

{% else %}
{% if swarm_services %}
{{ services_healthy }}/{{ swarm_services|length }} services healthy
{% endif %}
{{ running_count }} containers running
{{ failures|length }} failed in 24h
{# Swarm services — troubled first, each with its replicas' host chips (dashed = a node with no Steward agent, count-only from placement). #} {% if swarm_services %}
Swarm services
{% for s in swarm_services %}
{{ s.name }} {% if s.crash_looping %}crash-looping{% endif %} {% if s.state != 'healthy' and s.trouble_since %}since {{ s.trouble_since|ago }}{% endif %} {{ s.running }}/{{ s.desired }}
{% for r in s.replicas %} {% if r.ghost %} {{ r.host }} ×{{ r.count }} {% else %} {{ r.host }} {% endif %} {% endfor %}
{% endfor %}
{% endif %} {% if host_groups and swarm_services %}
Other containers
{% endif %} {% for g in host_groups %} {% if multi_host %}
{{ g.host_name }}
{% endif %}
{% for item in g.containers %} {% set c = item.c %}
{{ c.name }}{% if c.health == 'unhealthy' %} unhealthy{% endif %}{% if c.status == 'restarting' %} restarting{% 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.status == 'running' %}{{ cpu(item.usage) }}{% endif %}
{% endfor %}
{% endfor %} {% endif %}