{# docker/widget_resources.html — dashboard widget: the busiest running containers by CPU, each with labeled CPU + memory utilisation bars. #} {% if not rows %}
No running containers.
{% else %} {% macro bar(label, pct, warn, crit) %}
{{ label }}
{{ "%.1f" | format(pct) }}%
{% endmacro %}
{% for r in rows %} {% set c = r.c %}
{{ c.name }}{% if multi_host %} · {{ r.host_name }}{% endif %}
{% if c.cpu_pct is not none %}{{ bar("CPU", c.cpu_pct, 50, 80) }}{% endif %} {% if c.mem_pct is not none %}{{ bar("MEM", c.mem_pct, 70, 90) }}{% endif %}
{% endfor %}
{% endif %}