#5209 "Docker views: readable names, CPU/memory in cores and bytes, failures listed with since-time" (milestone 477 "UI problems first"). - A swarm task reads as its service and slot ("codex_db · 1", or the node for a global service), with the raw name in the title: Docker page, host panel, busiest widget, container detail. - CPU reads in cores (Docker's 100% = one core), toned by its share of the host's CPUs from the agent's per-core series. Memory reads in bytes, against a limit only when one is really set (Docker reports host RAM otherwise). - Exit 137/143 without an OOM kill is a stop, not a failure: no exited_nonzero, no crash-loop death, no "failed (24h)", dim exit code. - "Failed (24h)" is a list (Docker page #failures, linked from the widget and the tile): plain containers by their deaths, swarm services by Swarm's failed tasks; a second manager's copy of a task death counts once. - Failing swarm services lead Needs attention; services sort problems first with since-times on the page, the widget and the Swarm page; nodes that are down or drained sort first. - Busiest widget orders by a 5-minute CPU average so the list holds still. - Host panel: a table, problems first with what is wrong and since when; replaced swarm tasks hidden and counted. - Container detail: node hostname, I/O labelled "since start", Restarts hidden for swarm tasks with a note on where task failures are. - Widget names: "Docker — Services & failures", "Docker — Busiest containers". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
96 lines
5.1 KiB
HTML
96 lines
5.1 KiB
HTML
{# docker/swarm.html — Swarm topology: services, replica health, nodes, placement.
|
|
Services in trouble come first (crash loop, down, short), with since-times;
|
|
nodes that are down or not taking work come first. #}
|
|
{% extends "base.html" %}
|
|
{% from "_macros.html" import crumbs %}
|
|
{% block title %}Swarm — Docker — Steward{% endblock %}
|
|
{% block breadcrumb %}{{ crumbs([("Docker", "/plugins/docker/"), ("Swarm", "")]) }}{% endblock %}
|
|
{% block content %}
|
|
|
|
<h1 class="page-title" style="margin-bottom:1.5rem;">Swarm</h1>
|
|
|
|
{% if swarms %}
|
|
{% for g in swarms %}
|
|
<div style="margin-bottom:2rem;">
|
|
<div style="display:flex;align-items:baseline;gap:0.6rem;margin-bottom:0.75rem;flex-wrap:wrap;">
|
|
<span style="font-weight:500;font-size:0.95rem;">Swarm</span>
|
|
<span style="font-size:0.78rem;color:var(--text-muted);">
|
|
reported by {{ g.managers | length }} manager{{ 's' if g.managers | length != 1 }} · {{ g.managers | join(", ") }}
|
|
</span>
|
|
</div>
|
|
|
|
{# ── Services ─────────────────────────────────────────────────────────── #}
|
|
<div class="card-flush" style="margin-bottom:1rem;">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Service</th><th>Mode</th><th>Replicas</th><th>Image</th><th>Placement</th><th>Task failures</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for s in g.services %}
|
|
<tr>
|
|
<td style="font-weight:500;font-size:0.9rem;">{{ s.name }}</td>
|
|
<td style="font-size:0.82rem;color:var(--text-muted);">{{ s.mode }}</td>
|
|
<td style="font-family:ui-monospace,monospace;font-size:0.88rem;">
|
|
<span style="color:{% if s.healthy %}var(--green){% elif s.down %}var(--red){% elif s.degraded %}var(--orange){% else %}var(--text-muted){% endif %};">
|
|
{{ s.running }}/{{ s.desired }}
|
|
</span>
|
|
{% if s.state != 'healthy' and s.trouble_since %}<div style="font-family:inherit;font-size:0.72rem;color:var(--text-dim);" title="{{ s.trouble_since }}">since {{ s.trouble_since|ago }}</div>{% endif %}
|
|
</td>
|
|
<td style="font-size:0.8rem;color:var(--text-muted);max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{{ s.image or "—" }}</td>
|
|
<td style="font-size:0.78rem;color:var(--text-muted);">
|
|
{% for p in s.placement %}{{ p.node }} ({{ p.running }}){% if not loop.last %}, {% endif %}{% else %}—{% endfor %}
|
|
</td>
|
|
<td style="max-width:360px;">
|
|
{% include "docker/_swarm_failures.html" %}
|
|
{%- if not s.tasks_known %}<span style="font-size:0.78rem;color:var(--text-dim);" title="The reporting manager's agent predates task reporting (1.8.0); update it to see task failures.">—</span>
|
|
{%- elif not (s.crash_looping or s.failures_24h or (s.last_error and s.state != 'healthy')) %}<span style="font-size:0.78rem;color:var(--text-dim);">none in 24h</span>{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="6" style="color:var(--text-muted);font-size:0.85rem;text-align:center;padding:1.5rem;">No services in this swarm.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
{# ── Nodes ────────────────────────────────────────────────────────────── #}
|
|
<div class="card-flush">
|
|
<table class="table">
|
|
<thead>
|
|
<tr><th>Node</th><th>Role</th><th>Availability</th><th>Status</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for n in g.nodes %}
|
|
<tr>
|
|
<td style="font-weight:500;font-size:0.9rem;">
|
|
{{ n.hostname or n.node_id }}
|
|
{% if n.leader %}<span title="cluster leader" style="font-size:0.68rem;color:var(--accent);border:1px solid var(--accent);border-radius:3px;padding:0 0.3rem;margin-left:0.3rem;">leader</span>{% endif %}
|
|
</td>
|
|
<td style="font-size:0.82rem;color:var(--text-muted);">{{ n.role }}</td>
|
|
<td style="font-size:0.82rem;color:{% if n.availability == 'active' %}var(--text){% else %}var(--orange){% endif %};">{{ n.availability }}</td>
|
|
<td style="font-size:0.82rem;">
|
|
<span class="dot {% if n.status == 'ready' %}dot-up{% else %}dot-down{% endif %}"></span>
|
|
<span style="color:{% if n.status == 'ready' %}var(--green){% else %}var(--red){% endif %};">{{ n.status }}</span>
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="4" style="color:var(--text-muted);font-size:0.85rem;text-align:center;padding:1.5rem;">No nodes reported.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<div class="card" style="text-align:center;padding:3rem;">
|
|
<div style="color:var(--text-muted);font-size:0.9rem;">
|
|
No Swarm topology reported. A Steward host agent running on a Swarm
|
|
<strong>manager</strong> reports services, nodes, and task placement here —
|
|
workers and non-swarm hosts contribute only their local containers.
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|