Skip to content

Dashboard Extension

1. Overview

The Docker module extends the subscription dashboard with an Environments section, showing Portainer environment status and capacity using the OWL patch mechanism.


2. Environments Section

Displays all Portainer environments with their container counts and capacity.

Per Environment Card

  1. Environment Name - Display name
  2. Status Badge - Normal (green) or Over Capacity (red)
  3. Running Containers - Count with green badge
  4. Stopped Containers - Count with red badge (if any)
  5. Total Containers - Count with gray badge
  6. Capacity Bar - Visual progress bar showing running / max capacity
  7. Specs - CPU cores, RAM, and available slots

3. Technical Implementation

The dashboard extension uses OWL patch to add environments data without modifying the base subscription dashboard code.

  • JS: Patches SubscriptionDashboardComponent to add loadEnvironmentsData() method
  • XML: Template inheritance using xpath to inject the environments section after the charts row
  • API: Fetches data from /sadeem/dashboard/environments endpoint

Graceful Degradation

If the Docker module is not installed, the environments section simply doesn't appear. The dashboard works independently of the Docker module.