Fix Unraid 7.0.x compatibility: Add Folder button, VM crash, incognito placement - #15
Closed
chodeus wants to merge 10 commits into
Closed
Fix Unraid 7.0.x compatibility: Add Folder button, VM crash, incognito placement#15chodeus wants to merge 10 commits into
chodeus wants to merge 10 commits into
Conversation
The template referenced the old FolderView 2 variable `FOLDER_VIEW_DEBUG_MODE = true` which no longer exists. Updated to use the FV3 keyboard toggle (`fv3debug`) which enables debug mode, persists to localStorage, and activates all [FV3] console logging. https://claude.ai/code/session_01QYTVFVHb9mydcQXPL9xHp9
Make it clear that debug mode activates immediately when typing fv3debug (no Enter needed), and tell users to open the console first so they can see the confirmation message. https://claude.ai/code/session_01QYTVFVHb9mydcQXPL9xHp9
- .js-actions doesn't exist on Unraid 7.0.1, so the button injection
via prependTo('.js-actions') silently failed. Now falls back to
insertAfter the container/VM table (the approach upstream FV2 used)
- Wrap VNC port extraction in try/catch to prevent 500 errors from
domain_get_xml on older Unraid versions
https://claude.ai/code/session_01QYTVFVHb9mydcQXPL9xHp9
Instead of inserting after the table, place it directly after the Add Container / Add VM button so it sits in the toolbar row. https://claude.ai/code/session_01QYTVFVHb9mydcQXPL9xHp9
When .ToggleViewMode doesn't exist (Unraid 7.0.x), the button was inserted as a bare element before the table with no layout context. Now wraps it in a .fv3-incognito-bar div with flex styling so it displays properly regardless of Unraid version. https://claude.ai/code/session_01QYTVFVHb9mydcQXPL9xHp9
readInfo for VM type crashes silently on Unraid 7.0.1 despite readUnraidOrder using the same libvirt pattern successfully. Added step-by-step debug logs and try/catch around Libvirt init to pinpoint the exact failure point. https://claude.ai/code/session_01QYTVFVHb9mydcQXPL9xHp9
FV3 changed this to lazy loading but that breaks on Unraid 7.0.1 where readInfo for VM crashes silently. FV2 loaded it unconditionally at the top of lib.php and worked fine on the same system. Restoring that approach with a file_exists guard for systems without the VM plugin. The lazy loader function remains as a secondary safety check. https://claude.ai/code/session_01QYTVFVHb9mydcQXPL9xHp9
On 7.0.x the DOM has a DIV.title element ("Virtual Machines" /
"Docker Containers") above the table. Place the incognito button
right after that heading instead of directly before the table,
matching the visual position it has on 7.2+ inside .ToggleViewMode.
https://claude.ai/code/session_01QYTVFVHb9mydcQXPL9xHp9
Zero margin so the button sits within the existing gap between the page title and table without adding extra spacing. https://claude.ai/code/session_01QYTVFVHb9mydcQXPL9xHp9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.js-actionsdoesn't exist on older Unraid versions, so the button injection silently failed. Now falls back toinsertBefore('input[value="Add Container/Add VM"]')matching FV2's approach. 7.2+ users hit the existing.js-actionspath unchanged.libvirt_helpers.phpwas lazy-loaded insidereadInfo(), which crashes on 7.0.1. FV2 loaded it at the top oflib.phpand worked fine. Restored top-level loading withfile_existsguard. VNC port extraction (new in FV3) wrapped in try/catch. Added granular debug logging for future VM crash diagnosis..ToggleViewModedoesn't exist on 7.0.x, so the button was inserted as a bare element with no layout context. Now wraps in a.fv3-incognito-bardiv placed afterDIV.titleheading, matching the visual position on 7.2+.FOLDER_VIEW_DEBUG_MODE = truefrom FV2 which no longer exists. Updated to use thefv3debugkeyboard toggle.Files changed
folder.view3.Docker.pagefolder.view3.VMs.pagelib.phpshared.jsfolder-common.css.fv3-incognito-barwrapper stylingbug_report.ymlTest plan
fv3debugkeyboard toggle) works and produces console output