File manager: add UD shares to top level user shares#2147
Conversation
WalkthroughThe changes adjust the directory structure handling in the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant FileTree
Caller->>FileTree: Call is_low(rootdir)
alt rootdir equals $topdir
FileTree->>FileTree: Exclude folder from dropdown
else rootdir equals $userdir
FileTree->>FileTree: Iterate over udShares
FileTree->>FileTree: Check directory existence under $topdir
FileTree->>FileTree: Add unassigned shares
end
FileTree->>Caller: Return updated share list
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
emhttp/plugins/dynamix/include/FileTree.php (1)
88-93: Functionality added to display unassigned devices in user directory view.The implementation correctly adds unassigned devices top-level shares when browsing the user directory. The code:
- Checks if the current directory is
/mnt/user/- Iterates through
$udSharesarray ('disks' and 'remotes')- Adds them to the directory listing if they exist under
/mnt/Consider adding error handling for potential permission issues when accessing these directories.
if ($rootdir === $userdir) { // add unassigned devices top level shares - foreach ($udShares as $name) if (is_dir($topdir.$name)) { + foreach ($udShares as $name) { + $path = $topdir.$name; + if (is_dir($path) && is_readable($path)) { echo "<li class='directory collapsed'>$checkbox<a href='#' rel=\"{$topdir}{$name}/\">$name</a></li>"; + } } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
emhttp/plugins/dynamix/include/FileTree.php(2 hunks)
🔇 Additional comments (3)
emhttp/plugins/dynamix/include/FileTree.php (3)
48-49: Good variable extraction for path constants.Using dedicated variables for the directory paths improves code maintainability and readability.
82-82: Clean path reference update.Good refactoring to use the
$topdirvariable instead of hardcoding the path in the condition.
56-56:Details
❓ Verification inconclusive
Verify removal of 'addons' from unassigned device shares.
The
$udSharesarray has been modified to only include 'disks' and 'remotes', removing 'addons'. Make sure this aligns with the desired behavior for unassigned devices top-level shares.
🏁 Script executed:
#!/bin/bash # Check the structure under /mnt/ to verify if 'disks' and 'remotes' directories exist # This helps confirm the array changes are appropriate echo "Checking for directories in /mnt/" ls -la /mnt/ 2>/dev/null | grep -E "disks|remotes|addons" || echo "Directories not found"Length of output: 177
Confirm Removal of "addons" from Unassigned Device Shares
The
$udSharesarray inemhttp/plugins/dynamix/include/FileTree.php(line 56) now only includes"disks"and"remotes", with"addons"removed as intended. The shell script check on/mnt/returning “Directories not found” confirms that none of the directories (including"addons") are present in the test environment. Please verify in an environment where these mounts are populated that the removal aligns with the desired behavior for unassigned device shares.
Summary by CodeRabbit
New Features
textareaelements, ensuring a consistent look and feel.Refactor
Style
<textarea>element by removing inline CSS properties.