Improvements:
- Add PropTypes validation for component props (containers, errors, captureVersion)
- Use composite key for ports map instead of index for better React reconciliation
- Ensures type safety and follows codebase PropTypes conventions
This improves code quality and prevents potential runtime issues.
Critical fixes:
1. Monitor type detection on edit
- When editing a Docker monitor, type is now correctly detected from monitor object
- Previously defaulted to "hardware" causing incorrect form fields to show
- Fix: Detect type from query params on create, from monitor.type on edit
2. Default interval for Docker monitors
- Docker monitors now default to 30 seconds (0.5 minutes) on creation
- Hardware monitors remain at 15 seconds (0.25 minutes)
- Pass monitorType to initializeInfrastructureMonitorForCreate
3. Type-aware fallback links
- Hardware tab empty state: links to /infrastructure/create?type=hardware
- Docker tab empty state: links to /infrastructure/create?type=docker
- Ensures correct form is shown when creating from empty state
UX improvements:
4. Enhanced error messaging in Docker container table
- Differentiate between "No containers" vs "Docker daemon unavailable"
- Show error details when Capture API fails
- Display critical errors (docker.client) with red background
- Show partial error messages when some containers fail to inspect
5. Display Capture metadata
- Show Capture version in container table header
- Display error count when errors are present (⚠ N error(s) encountered)
- Help users identify API issues vs legitimate empty states
6. Improved empty state handling
- "Docker daemon unavailable" - when Docker socket unreachable on Capture server
- "No containers found" - when Capture is working but no containers exist
- "Partial data available" - when some containers failed to inspect
- Show specific error messages from Capture API
These changes improve the user experience when:
- Editing existing Docker monitors (correct form fields shown)
- Creating Docker monitors (proper default interval)
- Troubleshooting Capture API issues (clear error messages)
- Understanding container availability (version info, error details)
This commit completes the Docker container monitoring feature using Capture API.
Frontend changes:
- Updated Infrastructure create/edit form to support Docker monitors
- Conditional UI based on monitor type (hardware vs docker)
- Docker-specific labels and placeholders
- Capture server URL field (e.g., http://192.168.1.100:59232)
- API secret field for Bearer token authentication
- Enforced 30-second minimum polling interval for Docker
- Conditionally hide hardware thresholds for Docker monitors
- Updated useInfrastructureSubmit hook
- Accept monitorType parameter (hardware or docker)
- Build form with type-specific fields
- Only add thresholds for hardware monitors
- Submit with correct monitor type to backend
- Created DockerContainersTable component
- Displays all containers from Capture API response
- Shows: container name, ID, status, health, image, uptime, ports
- Color-coded status indicators (green=healthy, yellow=warning, red=error)
- Formats uptime/downtime duration
- Handles empty state gracefully
- Updated Infrastructure Details page
- Conditionally render Docker container table for docker monitors
- Keep existing hardware metrics (gauges, charts) for hardware monitors
- Hide network tab for Docker monitors (not applicable)
- Display container data from latest check
Implementation complete and ready for testing.
Backend changes:
- Update Check model to store Docker container data (container_id, status, health, ports, etc.)
- Refactor networkService to support both local Docker and remote Capture API
- requestLocalDocker: Existing local Docker socket monitoring
- requestCaptureDocker: New Capture API endpoint integration
- requestDocker: Routes based on URL pattern (http/https vs container name)
- Update statusService to handle Docker check data storage
- Enforce proper error handling for Capture API (401, 404, 500, 207 responses)
Frontend changes:
- Add Hardware/Docker tabs to Infrastructure page
- Add query parameter support for monitor type selection
- Prepare form for Docker monitor creation (partial)
Status: Backend complete, frontend in progress
Next: Complete Docker monitor form, add container table component, test end-to-end
Removed the following unused CSS variables that were leftovers from when
the project switched to the MUI theme system:
- --env-var-radius-1
- --env-var-width-1
- --env-var-width-3
- --env-var-height-1
- --env-var-spacing-3
- --env-var-spacing-4
- --env-var-spacing-5
- --env-var-img-width-1
- --env-var-img-width-2
- --env-var-img-width-3
- --env-var-default-1
- --env-var-default-2
- --env-var-shadow-1
These variables are not referenced anywhere in the codebase. The project
now uses MUI theme configuration (theme.spacing(), theme.palette.*)
instead of CSS variables for styling.
Kept 19 CSS variables that are still actively used during the migration
to pure MUI theme.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>