{# docker/host_panel.html — per-host Docker fragment embedded on the Hosts hub: problems first with what is wrong and since when, then the busiest running containers; the rest of the running and the stopped fold away so the card stays short (#5276). Tasks Swarm has replaced are left out (counted in the header). #} {% from "_macros.html" import status_badge, status_dot %} {% from "docker/_usage.html" import cpu, mem %} {% macro container_table(rows) %}
| Container | CPU | Memory |
|---|---|---|
|
{{ status_dot('crit' if r.problems else ('up' if c.status == 'running' else 'inactive'), c.status|capitalize) }}
{{ r.label }}
{% if r.problems %}
{% set worst = r.problems[0] %}
{{ status_badge('crit' if severity[worst] == 'critical' else 'warn', worst|replace('_', ' ')|capitalize) }}
{%- for p in r.problems %} {{ says[p] }}{{ " and" if not loop.last }}{% endfor %}
{%- if c.exit_code %} · exit {{ c.exit_code }}{% if c.oom_killed %} (OOM){% endif %}{% endif %}
{%- if r.since %} · since {{ r.since|ago }}{% endif -%}
{% else %}
{{ c.status }}{% if r.uptime %} · up {{ r.uptime }}{% endif %}
{%- if c.status != 'running' and c.exit_code %} · exit {{ c.exit_code }}{% endif %}
{% endif %}
|
{% if c.status == 'running' %}{{ cpu(r.usage) }}{% else %}—{% endif %} | {% if c.status == 'running' %}{{ mem(r.usage) }}{% else %}—{% endif %} |