Skip to content

feat(docker): allow SVG icons for Docker containers#2663

Open
zysenia wants to merge 1 commit into
unraid:masterfrom
zysenia:enhancement/docker-container-icons
Open

feat(docker): allow SVG icons for Docker containers#2663
zysenia wants to merge 1 commit into
unraid:masterfrom
zysenia:enhancement/docker-container-icons

Conversation

@zysenia

@zysenia zysenia commented Jun 11, 2026

Copy link
Copy Markdown

Purpose

Right now only .png files are treated as valid Docker container icons in the WebGUI. Everything else falls back to FontAwesome icons.

Added

Adds support for .svg icons in the same rendering path as PNG icons.

Notes

  • PNG support stays exactly the same
  • SVG is handled the same way as PNG in the icon rendering path
  • No other logic changed

Summary by CodeRabbit

  • Refactor

    • Updated Docker container UI icon rendering system with improved selection logic, maintaining all existing visual output and fallback behaviors.
  • Bug Fixes

    • Fixed host IP address selection in external port binding configuration.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2cf22604-5be7-455e-bc77-1a4c0234cec4

📥 Commits

Reviewing files that changed from the base of the PR and between d9c5bbc and 4b6c9f5.

📒 Files selected for processing (1)
  • emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php

Walkthrough

Docker container UI icon rendering logic was refactored to check file extensions (PNG, SVG) against an array before selecting image-based output; the same fallback behavior for icon classes and FontAwesome icons remains. Host IP selection in port-binding logic had trailing whitespace removed while preserving conditional behavior.

Changes

Docker Container UI Icon and Port Binding Updates

Layer / File(s) Summary
Icon rendering refactor and host IP whitespace adjustment
emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php
Icon selection logic now uses in_array() for case-insensitive PNG/SVG extension detection before returning <img> tags with onerror fallback; icon-* and fa fa-* fallback branches preserved. Host IP assignment line whitespace normalized with no logic change.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A docker icon quest so small,
Cleaner logic for them all,
Extensions checked with style so neat,
Port bindings whitespace beat—
Web GUI now complete!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding SVG icon support for Docker containers, which directly matches the changeset modifications to icon rendering logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.06.11.1222
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2663/webgui-pr-2663.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2663, or run:

plugin remove webgui-pr-2663

🤖 This comment is automatically generated and will be updated with each new push to this PR.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant