[PR #4090] [MERGED] Feat: Random Script picker for Website #4678

Closed
opened 2026-02-26 14:31:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/4090
Author: @michelroegl-brunner
Created: 4/28/2025
Status: Merged
Merged: 4/29/2025
Merged by: @tremor021

Base: mainHead: featur/random-script


📝 Commits (3)

📊 Changes

2 files changed (+67 additions, -18 deletions)

View changed files

📝 frontend/src/components/CommandMenu.tsx (+61 -18)
package-lock.json (+6 -0)

📄 Description

✍️ Description

Added a new /random-script page that displays a random script from the available scripts collection, with the ability to re-roll for a new random script.

Changes

  • Created new page at /frontend/src/app/random-script/page.tsx
  • Reuses existing ScriptItem component for consistent script display
  • Implements random script selection from all available scripts
  • Adds a "Re-Roll" button to get a new random script
  • Maintains consistent styling with the existing scripts page
  • Handles loading and error states appropriately

Technical Details

  • Uses fetchCategories to get all available scripts
  • Implements client-side random selection
  • No backend changes required
  • Fully responsive design
  • Maintains existing theme and styling patterns

Testing

  • Verify random script selection works
  • Check re-roll functionality
  • Confirm loading states display correctly
  • Ensure error state shows when no scripts are available
  • Verify responsive design on different screen sizes

Screenshot

image

https://community-scripts.github.io/ProxmoxVED/random-script

Link: #4046

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔄 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/pull/4090 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 4/28/2025 **Status:** ✅ Merged **Merged:** 4/29/2025 **Merged by:** [@tremor021](https://github.com/tremor021) **Base:** `main` ← **Head:** `featur/random-script` --- ### 📝 Commits (3) - [`b030407`](https://github.com/community-scripts/ProxmoxVE/commit/b03040703eea3e23d129e337f18bf84da99b4b72) Feat: Random Script picker - [`f957987`](https://github.com/community-scripts/ProxmoxVE/commit/f957987900a0c647b43db8e1fa002ad5682ff12c) Remove extra site - [`8bdf084`](https://github.com/community-scripts/ProxmoxVE/commit/8bdf084ce579fa86e3506603d4ef65e5f286a859) Changes for Mick ### 📊 Changes **2 files changed** (+67 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/CommandMenu.tsx` (+61 -18) ➕ `package-lock.json` (+6 -0) </details> ### 📄 Description <!--🛑 New scripts must be submitted to [ProxmoxVED](https://github.com/community-scripts/ProxmoxVED) for testing. PRs without prior testing will be closed. --> ## ✍️ Description Added a new `/random-script` page that displays a random script from the available scripts collection, with the ability to re-roll for a new random script. ### Changes - Created new page at `/frontend/src/app/random-script/page.tsx` - Reuses existing `ScriptItem` component for consistent script display - Implements random script selection from all available scripts - Adds a "Re-Roll" button to get a new random script - Maintains consistent styling with the existing scripts page - Handles loading and error states appropriately ### Technical Details - Uses `fetchCategories` to get all available scripts - Implements client-side random selection - No backend changes required - Fully responsive design - Maintains existing theme and styling patterns ### Testing - Verify random script selection works - Check re-roll functionality - Confirm loading states display correctly - Ensure error state shows when no scripts are available - Verify responsive design on different screen sizes ### Screenshot ![image](https://github.com/user-attachments/assets/59333188-e794-49f4-adb0-d741944e8f7a) https://community-scripts.github.io/ProxmoxVED/random-script ## 🔗 Related PR / Issue Link: #4046 ## ✅ Prerequisites (**X** in brackets) - [X] **Self-review completed** – Code follows project standards. - [X] **Tested thoroughly** – Changes work as expected. - [X] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [ ] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [X] ✨ **New feature** – Adds new, non-breaking functionality. - [ ] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [ ] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [ ] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 14:31:44 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE#4678
No description provided.