BUG: Containers tab always shows RUNNING badge and hardcoded 0% CPU / 0 MB memory #84

Closed
opened 2026-05-25 18:46:12 -04:00 by zgaetano · 0 comments
Owner

Description

Two issues in the Containers admin tab (GET /api/v1/cluster/containers):

1. State badge always says "RUNNING"

screens-admin.jsx renders <span className="badge success">RUNNING</span> unconditionally — it never reads c.state to display the actual container state (e.g., "exited", "paused", "restarting").

2. CPU and memory hardcoded to 0

services/mam-api/src/routes/cluster.js maps Docker API results to frontend fields with hardcoded zeros:

return {
  ...
  cpu: 0,  // hardcoded — never computed from Docker stats
  mem: 0,  // hardcoded — never computed from Docker stats
};

The frontend Containers component renders these values as progress bars and labels, always showing 0.0% CPU and 0 MB memory.

Impact: The Containers tab is misleading:

  • Stopped/exited containers are shown as "RUNNING"
  • Resource usage columns are always zero, making the tab effectively useless for monitoring

Suggestions:

  • For the state badge, switch on c.state (e.g., running, exited, paused) and render an appropriate badge/color
  • For CPU/memory, either compute from Docker stats (requires additional API calls via docker stats --no-stream) or hide the columns with a note such as "Docker stats not yet wired"
## Description Two issues in the **Containers** admin tab (`GET /api/v1/cluster/containers`): ### 1. State badge always says "RUNNING" `screens-admin.jsx` renders `<span className="badge success">RUNNING</span>` unconditionally — it never reads `c.state` to display the actual container state (e.g., "exited", "paused", "restarting"). ### 2. CPU and memory hardcoded to 0 `services/mam-api/src/routes/cluster.js` maps Docker API results to frontend fields with hardcoded zeros: ```js return { ... cpu: 0, // hardcoded — never computed from Docker stats mem: 0, // hardcoded — never computed from Docker stats }; ``` The frontend `Containers` component renders these values as progress bars and labels, always showing `0.0%` CPU and `0 MB` memory. **Impact:** The Containers tab is misleading: - Stopped/exited containers are shown as "RUNNING" - Resource usage columns are always zero, making the tab effectively useless for monitoring **Suggestions:** - For the state badge, switch on `c.state` (e.g., `running`, `exited`, `paused`) and render an appropriate badge/color - For CPU/memory, either compute from Docker stats (requires additional API calls via `docker stats --no-stream`) or hide the columns with a note such as "Docker stats not yet wired"
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: WildDragonLLC/dragonflight#84
No description provided.