Skip to content

Beta: Add CPU & Memory Load to advanced view mode; Use integrated Ace editor if available; Right click to access context menu#74

Open
mstrhakr wants to merge 81 commits intomainfrom
dev
Open

Beta: Add CPU & Memory Load to advanced view mode; Use integrated Ace editor if available; Right click to access context menu#74
mstrhakr wants to merge 81 commits intomainfrom
dev

Conversation

@mstrhakr
Copy link
Copy Markdown
Owner

@mstrhakr mstrhakr commented Mar 30, 2026

Beta: CPU & Memory Load, Integrated Ace Editor, Context Menus, Local Icon Paths, and More

Summary

This beta consolidates several features, bug fixes, and performance improvements across the Compose Manager plugin. Key highlights include real-time CPU & memory metrics in advanced view, refactored Ace Editor delivery, right-click context menus, local file path support for icons, and significant caching/performance work.


Features

  • CPU & Memory Load in Advanced View — Real-time per-container and aggregate per-stack CPU/memory metrics via the dockerload Nchan WebSocket channel. Includes usage bars, visibility-aware rendering, stale-data pruning, and tab/browser-visibility optimizations.
  • Right-Click Context Menus — Right-click anywhere on a stack or container row (Compose tab and Dashboard) to open the context menu, matching the icon-click behavior.
  • Ace Editor Integration Refactored — Prefer Dynamix's bundled Ace on Unraid 7.0.0+; download at install time for older versions. Removed Ace from the build package entirely. Guards and fallbacks added for when Ace is unavailable.
  • Local Icon Path Support — Stack and container icon fields now accept local server paths (under /mnt/ or /boot/config/plugins/compose.manager/projects/) in addition to http(s) URLs and data: URIs.
  • File Picker for Icon Fields — Icon URL inputs in the editor modal (both stack Settings and per-container Web UI Labels) now include a file tree picker.
  • Compose Up for Running Stacks — Re-added the "Compose Up" option to the context menu for already-running stacks, enabling profile-scoped service starts.
  • Multi-Host Deploydeploy.ps1 and new deploy.sh now accept multiple remote hosts for parallel deployments.
  • Bash Build/Deploy/Test Scripts — Added build.sh, deploy.sh, and test.sh for Linux-native workflows alongside the existing PowerShell scripts.

Bug Fixes

  • Profiles overwritten with empty string — Confirmation dialog was overwriting the selected profile with an empty string in the payload.
  • Profiles retrieval improved — Added caching with staleness detection and extraction via docker compose config --profiles when cache is stale.
  • Uptime display consistency — Use a single stack-level started_at timestamp instead of per-container earliest, preventing jumps when details are expanded.
  • Column widths — Adjusted arrow and icon column widths to fixed px values for better small screen and mobile support.
  • dockerload WebSocket — Improved subscriber lifecycle management, visibility-change handling, message caching, tab-switch detection, and stale-entry pruning.
  • Override file handling — Existing compose and override filenames are now preserved as-is (no auto-rename from docker-compose.override.yml to compose.override.yaml).
  • Icon cache headers — Changed icon proxy Cache-Control to no-cache, must-revalidate so icon changes reflect immediately.
  • show_ttyd.php — Ensure autov() is available with proper fallback.
  • autov call style — Normalized <?autov(...)?> to <?php autov(...); ?> across all page files for consistency.

Performance

  • Persistent file cache for getDefinedServices() — Avoids re-running docker compose config --services on every page load when compose files haven't changed.
  • Persistent file cache for hasBuildConfig() — Same staleness-based caching for build detection.
  • Profiles file cachegetProfiles() now uses the metadata file with filemtime-based staleness checks.
  • Removed unused docker compose ls — Eliminated the batch docker compose ls call from compose_list.php that was no longer needed.
  • StackInfo::allFromRoot() $skipDocker option — Allows skeleton rendering without triggering per-stack Docker calls.
  • dockerload stack index caching — Pre-built stackId → containerIds[] index avoids per-tick DOM traversal.

CI/CD & Build

  • CodeQL workflow — Added custom CodeQL workflow with [skip ci] / release-bot commit filtering.
  • Stable tag detection — Tightened regex in tag-release.yml to exclude beta tags.
  • Removed ACE_VERSION — Removed from versions.env, build workflows, build.ps1, build_in_docker.sh, and pkg_build.sh. Ace is now delivered at plugin install time.

Code Quality

  • ShellCheck fixes — Quoting, mapfile usage, read -r, proper [[ ]] conditionals across compose.sh, autostart.sh, patch_util.sh, scheduled_backup.sh, and install.sh.
  • Override resolution refactored — Non-destructive legacy handling; no more .bak renames.
  • Removed outdated project upgrade logic — The version-1 docker-compose.ymlcompose.yaml migration block was removed from the PLG.

Related Issues

Issue Title Status in this PR
#72 Add CPU + MEM display to advanced view mode Closes
#79 Allow Compose Up of running stack Closes
#80 Profile support broken Closes
#82 Icons not working on docker tab Partial fix — needs further investigation
#83 Can't use local file for stack icon Closes

Testing Notes

  • CPU & Memory Load — Toggle to Advanced View and verify per-stack and per-container CPU/memory metrics update in real time. Switch browser tabs or Unraid tabs and confirm metrics resume on return.
  • Context Menus — Right-click stack and container rows on both the Compose tab and Dashboard; verify the correct context menu opens at the cursor position.
  • Ace Editor — On Unraid 7.0.0+ verify Ace loads from Dynamix. On older Unraid verify the PLG downloads Ace at install. Simulate Ace missing and confirm the editor shows a user-friendly error instead of crashing.
  • Local Icons — Set a stack icon to a local path like /mnt/user/.../icon.png and verify it renders on the Compose tab. Use the file picker to browse and select an icon.
  • Profiles — Create a stack with multiple profiles, run Compose Up with a specific profile, and verify the --profile flag is passed correctly.
  • Override Filenames — Existing docker-compose.override.yml files should be used as-is without being renamed.
  • Multi-Host Deploy — Test deploy.sh -Dev -RemoteHost host1,host2 to verify parallel deployment to multiple hosts.

Diff

Full diff: v2026.03.28...dev

mstrhakr added 30 commits March 28, 2026 10:14
… Ace is missing

When Ace fails to load, initEditorModal() returns early leaving
editorModal.editors[type] undefined. loadEditorFiles(), saveTab(),
and the post-save validation callback all accessed these without
guards, causing TypeError crashes.

Add null checks on every unguarded editorModal.editors[type] access
in loadEditorFiles, saveTab, and the save-success validation callback.
Remove stale AceVersion parameter declaration, documentation, and
print statement that were missed during the Ace removal.
The settings page doesn't include compose_manager_main.php, so the
JS aceBasePath variable was undefined. The typeof fallback defaulted
to /webGui/javascript/ace which is correct on 7.0.0+ but wrong on
6.x where ace lives in the plugin directory.

Use the same PHP file_exists() detection to resolve the correct
path server-side and emit it directly into the JS.
Ace modes try to load worker scripts (worker-yaml.js, worker-sh.js)
via the module loader. Since we only bundle a minimal subset of Ace
files, these would 404 and throw loader errors. Disable workers via
session.setUseWorker(false) — we already validate YAML client-side
via js-yaml so workers are redundant.
Only disable certificate checking when no system CA bundle exists.
Previously wget --no-check-certificate was used unconditionally,
which could allow MITM substitution of the downloaded JS assets.
Check unzip and cp exit codes and verify ace.js exists after install.
Previously a failed extraction would silently print success, leaving
users with missing editor files and no diagnostic output.
Help text said Default: 2.40.3 but actual default is 5.0.2.
When Ace fails to load, opening the editor modal would show an empty
non-functional UI. Instead, prevent the modal from opening entirely
and show a swal error prompting the user to reload or check the
plugin installation.
- Add missing 'var loadMap = {}' declaration
- Fix cpuRaw used before declaration (moved above cpuNorm)
- Remove duplicate cpuNorm/loadMap assignments and orphan braces
- Add parts.length >= 3 guard to skip malformed rows
- Use Math.max(composeCpuCount, 1) to prevent division by zero
The .ct-col-icon class is defined in CSS but never used in any HTML
output. Container detail tables have no icon column.
Stopped stacks and containers will never receive docker stats data,
so showing '0%' / '0B' is misleading. Show '-' instead and hide the
usage bar and memory span for non-running entries.
mstrhakr and others added 30 commits March 30, 2026 08:15
… overwriting the good data with an empty string
hasBuildConfig() previously ran 'docker compose config' (full config
dump, ~300-500ms) on every page load for every stack, with only an
in-memory cache that didn't survive across requests.

Add a 'has_build' metadata file in the stack directory following the
same pattern used by getProfiles(): read from file cache when the
compose and override files haven't changed (mtime check), fall back
to docker compose config on cache miss, and write-through on
extraction.

This eliminates N subprocess calls (one per stack) on warm page loads.
getDefinedServices() previously ran 'docker compose config --services'
(~300-500ms) on every page load for every stack with no persistent
cache at all.

Add a 'services' metadata file in the stack directory following the
same pattern used by getProfiles() and hasBuildConfig(): read from the
JSON file cache when the compose and override files haven't changed
(mtime check), fall back to docker compose config --services on cache
miss, and write-through on extraction.

This eliminates N subprocess calls (one per stack) on warm page loads.
Add isValidIconSrc() helper that accepts http(s) URLs, data URIs, and
local server paths (starting with /) for icon sources. Update container
detail view and action dialog icon checks to use it instead of
http/https-only validation.

Fixes icons showing fallback '?' on the Compose tab when a container's
net.unraid.docker.icon label contains a local cached path.

Ref: #82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants