[PR #120] [MERGED] Fix: Detect downloaded scripts from all directories (ct, tools, vm) #195

Closed
opened 2025-11-20 04:13:27 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE-Local/pull/120
Author: @michelroegl-brunner
Created: 10/13/2025
Status: Merged
Merged: 10/13/2025
Merged by: @michelroegl-brunner

Base: mainHead: fix/addons_vms_tools_notshown


📝 Commits (2)

  • 40857fe Fix: Detect downloaded scripts from all directories (ct, tools, vm, vw)
  • b4e168c Fix: Remove redundant type annotation and method call arguments

📊 Changes

5 files changed (+102 additions, -3 deletions)

View changed files

📝 src/app/_components/DownloadedScriptsTab.tsx (+1 -1)
📝 src/app/_components/ScriptsGrid.tsx (+1 -1)
📝 src/app/page.tsx (+1 -1)
📝 src/server/api/routers/scripts.ts (+10 -0)
📝 src/server/lib/scripts.ts (+89 -0)

📄 Description

Problem

Scripts downloaded to directories other than scripts/ct/ were not being detected and shown in the Downloaded Scripts tab. The Available Scripts tab also showed incorrect download status for scripts in tools/, vm/, and vw/ directories.

Solution

  • Added getAllDownloadedScripts() method to ScriptManager class that scans all script directories (ct, tools, vm, vw)
  • Added recursive directory scanning to handle subdirectories like tools/pve/
  • Updated DownloadedScriptsTab to use the new API endpoint
  • Updated ScriptsGrid to use the new API endpoint for download status detection
  • Updated main page script counts to use the new API endpoint
  • Maintained backward compatibility with existing getCtScripts endpoint

Changes

  • src/server/lib/scripts.ts: Added getAllDownloadedScripts() and recursive getScriptsFromDirectory() methods
  • src/server/api/routers/scripts.ts: Added getAllDownloadedScripts API endpoint
  • src/app/page.tsx: Updated to use new API for script counts
  • src/app/_components/DownloadedScriptsTab.tsx: Updated to use new API endpoint
  • src/app/_components/ScriptsGrid.tsx: Updated to use new API endpoint

Testing

  • Verified API returns scripts from all directories (ct, tools, vm, vw)
  • Confirmed Downloaded Scripts tab shows all downloaded scripts
  • Confirmed Available Scripts tab shows correct download status
  • Maintained backward compatibility with existing functionality

Fixes the issue where scripts downloaded to non-ct directories were not properly tracked or displayed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE-Local/pull/120 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 10/13/2025 **Status:** ✅ Merged **Merged:** 10/13/2025 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `fix/addons_vms_tools_notshown` --- ### 📝 Commits (2) - [`40857fe`](https://github.com/community-scripts/ProxmoxVE-Local/commit/40857fe862247da4a5b326aa28b2d1d94aa8bf67) Fix: Detect downloaded scripts from all directories (ct, tools, vm, vw) - [`b4e168c`](https://github.com/community-scripts/ProxmoxVE-Local/commit/b4e168c29489643408bdd5db0405235a502d9a7e) Fix: Remove redundant type annotation and method call arguments ### 📊 Changes **5 files changed** (+102 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/app/_components/DownloadedScriptsTab.tsx` (+1 -1) 📝 `src/app/_components/ScriptsGrid.tsx` (+1 -1) 📝 `src/app/page.tsx` (+1 -1) 📝 `src/server/api/routers/scripts.ts` (+10 -0) 📝 `src/server/lib/scripts.ts` (+89 -0) </details> ### 📄 Description ## Problem Scripts downloaded to directories other than `scripts/ct/` were not being detected and shown in the Downloaded Scripts tab. The Available Scripts tab also showed incorrect download status for scripts in `tools/`, `vm/`, and `vw/` directories. ## Solution - Added `getAllDownloadedScripts()` method to `ScriptManager` class that scans all script directories (ct, tools, vm, vw) - Added recursive directory scanning to handle subdirectories like `tools/pve/` - Updated `DownloadedScriptsTab` to use the new API endpoint - Updated `ScriptsGrid` to use the new API endpoint for download status detection - Updated main page script counts to use the new API endpoint - Maintained backward compatibility with existing `getCtScripts` endpoint ## Changes - `src/server/lib/scripts.ts`: Added `getAllDownloadedScripts()` and recursive `getScriptsFromDirectory()` methods - `src/server/api/routers/scripts.ts`: Added `getAllDownloadedScripts` API endpoint - `src/app/page.tsx`: Updated to use new API for script counts - `src/app/_components/DownloadedScriptsTab.tsx`: Updated to use new API endpoint - `src/app/_components/ScriptsGrid.tsx`: Updated to use new API endpoint ## Testing - Verified API returns scripts from all directories (ct, tools, vm, vw) - Confirmed Downloaded Scripts tab shows all downloaded scripts - Confirmed Available Scripts tab shows correct download status - Maintained backward compatibility with existing functionality Fixes the issue where scripts downloaded to non-ct directories were not properly tracked or displayed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 04:13:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE-Local#195