- Not enough samples in the last {{ range_key }} yet. History fills in as the agents report its replicas. + Not enough samples in the last {{ range_key }} yet. History fills in as the agent reports.
{% endif %} diff --git a/plugins/docker/templates/docker/container_detail.html b/plugins/docker/templates/docker/container_detail.html index 5931077..44e9f35 100644 --- a/plugins/docker/templates/docker/container_detail.html +++ b/plugins/docker/templates/docker/container_detail.html @@ -1,98 +1,94 @@ -{# docker/container_detail.html — full detail page for one container. A swarm - task is titled by its service and slot, with the raw container name under - it; CPU reads in cores and memory in bytes (see _usage.html). #} +{# docker/container_detail.html — one container (#5310), shaped like a + service's page: a header that says whether it is well and what it is; why + it stopped, only while it has; what it moved since it started; its CPU and + memory over time (the one home for what it uses now); its lifecycle. + A swarm task is titled by its service and slot, the raw name under it. #} {% extends "base.html" %} -{% from "_macros.html" import crumbs %} -{% from "docker/_usage.html" import cpu, mem %} +{% from "_macros.html" import crumbs, status_badge %} {% block title %}{{ label or name }} — Docker — Steward{% endblock %} -{% block breadcrumb %}{{ crumbs([("Docker", "/plugins/docker/"), (label or name, "")]) }}{% endblock %} +{% block breadcrumb %} +{%- if container is not none and container.service_name -%} +{{ crumbs([("Docker", "/plugins/docker/"), (container.service_name, "/plugins/docker/service/" ~ container.service_name), (label, "")]) }} +{%- else -%} +{{ crumbs([("Docker", "/plugins/docker/"), (label or name, "")]) }} +{%- endif -%} +{% endblock %} {% block content %} {% if container is none %} -{{ name }} is currently reported for this host.
- It may have been removed, or the host agent hasn't reported recently.
- {{ name }} is reported for this host now. It may have been
+ removed, or the host agent has not reported recently. Back to Docker
+ {% if c.status == 'running' %}{{ status_badge('ok', 'Running') }} + {% elif c.status == 'restarting' %}{{ status_badge('crit', 'Restarting') }} + {% elif c.status == 'paused' %}{{ status_badge('warn', 'Paused') }} + {% elif exit_failed %}{{ status_badge('crit', c.status|capitalize) }} + {% else %}{{ status_badge('dim', c.status|capitalize) }}{% endif %} + {%- if c.health == 'unhealthy' %} {{ status_badge('crit', 'Unhealthy') }} + {%- elif c.health == 'starting' %} {{ status_badge('pending', 'Starting') }} + {%- elif c.health == 'healthy' %} {{ status_badge('ok', 'Healthy') }}{% endif %} + {%- if uptime %} · up {{ uptime }}{% endif %} + {%- if host %} · on {{ host.name }}{% endif %} + {%- if c.service_name %} · task of {{ c.service_name }} + {%- elif c.compose_project %} · compose {{ c.compose_project }}{% endif %} + {%- if c.image %} · {{ c.image.split("@")[0] }}{% endif %} +
++ {%- if label != c.name %}{{ c.name }} · {% endif -%} + {%- if c.scraped_at %}reported {{ c.scraped_at|ago }}{% endif -%} +
+ Exited {{ c.exit_code }}{% if c.oom_killed %}: killed for running out of memory{% endif %} + {%- if died_at %} · {{ died_at|ago }}{% endif %} + · its logs → +
+Loading…
| Event | Detail | When |
|---|---|---|
| {{ e.event|replace("_", " ") }} | +{{ e.detail or "" }} | +{{ e.at|ago }} | +
No lifecycle events recorded yet. Starts, stops and health changes appear here as the agent reports them.
{% endif %} -{% if row.crash_looping %}{{ status_badge('crit', 'Crash-looping') }} @@ -33,16 +38,25 @@ {% elif row.state == 'degraded' %}{{ status_badge('warn', 'Degraded') }} {% else %}{{ status_badge('ok', 'Healthy') }}{% endif %} {{ row.running }} of {{ row.desired }} running + {%- if troubled and row.trouble_since %} · in trouble since {{ row.trouble_since|ago }}{% endif %} · {{ row.mode }} {%- if stack %} · stack {{ stack }}{% endif %} - {%- if row.trouble_since %} · in trouble since {{ row.trouble_since|ago }}{% endif %} + {%- if image %} · {{ image.split("@")[0] }}{% endif %}
+ {% if (not troubled and e) or svc %} ++ {%- if not troubled and e %}Last failed {% if e.age_s is not none %}{{ e.age_s|duration }} ago{% endif %} + {%- if e.exit_code %} (exit {{ e.exit_code }}){% endif %} + {%- if e.task_id %} · its logs{% endif %} · {% endif -%} + {%- if svc %}reported {{ svc.updated_at|ago }} by the manager's agent{% endif -%} +
+ {% endif %}@@ -53,60 +67,10 @@
| Node | Container | Status | -CPU | Memory | Up | -||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ r.host }} | -{{ r.count }} running on a node with no Steward agent: no figures for {{ "it" if r.count == 1 else "them" }} | - {% else %} -{% if r.host_id %}{{ r.host }}{% else %}{{ r.host }}{% endif %} | -{{ r.name }} | -- {{ status_dot('up' if r.status == 'running' else 'down') }} {{ r.status }} - {%- if r.health == 'unhealthy' %} {{ status_badge('crit', 'Unhealthy') }}{% elif r.health == 'starting' %} {{ status_badge('pending', 'Starting') }}{% endif %} - | -{% if r.usage %}{{ cpu(r.usage) }}{% else %}—{% endif %} | -{% if r.usage %}{{ mem(r.usage) }}{% else %}—{% endif %} | -{{ r.uptime or "—" }} | - {% endif %} -||||
No replica is running.
- {% endif %} -| Slot | Task | Node | State | -Exit | Why | When | +CPU | Memory | +Exit | Why | When |
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ t.slot or "—" }} | -{% if t.task_id %}{{ t.task_id[:10] }}{% else %}—{% endif %} | -{{ t.node }} | ++ {%- if t.task_id %}{{ t.task_id[:10] }} + {%- if t.container and t.host_id %} ↗{% endif %} + {%- elif t.container and t.host_id %}{{ t.container|truncate(24, true, "…") }} + {%- else %}—{% endif -%} + | +{% if t.host_id %}{{ t.node }}{% else %}{{ t.node }}{% endif %} | {%- if t.failed %}{{ status_badge('crit', t.state|capitalize) }} {%- elif t.current %}{{ status_badge('ok', 'Running') }} {%- else %}{{ t.state }}{% endif %} + {%- if t.health == 'unhealthy' %} {{ status_badge('crit', 'Unhealthy') }}{% elif t.health == 'starting' %} {{ status_badge('pending', 'Starting') }}{% endif %} {%- if t.desired and t.desired != t.state and not t.current %} → {{ t.desired }}{% endif -%} | +{% if t.usage %}{{ cpu(t.usage) }}{% else %}—{% endif %} | +{% if t.usage %}{{ mem(t.usage) }}{% else %}—{% endif %} | {% if t.exit_code %}{{ t.exit_code }}{% else %}—{% endif %} | {{ t.why or "" }} | {% if t.at %}{{ t.at|ago }}{% else %}—{% endif %} | @@ -146,7 +121,7 @@
No task record yet: the manager's agent reports them from version 1.8.0.
+No task is running, and Swarm's record of its tasks has not been reported yet (the manager's agent reports it from version 1.8.0).
{% endif %}