[PR #426] [MERGED] Frontend: fix reported issue with json-editor page and add OS select in installmethod #2524

Closed
opened 2025-11-20 05:30:29 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/426
Author: @BramSuurdje
Created: 11/22/2024
Status: Merged
Merged: 11/23/2024
Merged by: @MickLesk

Base: mainHead: fix-json-page-numbering


📝 Commits (1)

  • 0f64190 Enhance InstallMethod component: add operating system selection and version handling with new input structure

📊 Changes

3 files changed (+138 additions, -81 deletions)

View changed files

📝 frontend/src/app/json-editor/_components/InstallMethod.tsx (+109 -80)
📝 frontend/src/config/siteConfig.tsx (+19 -1)
📝 frontend/src/lib/types.ts (+10 -0)

📄 Description

…ersion handling with new input structure

Note

We are meticulous when it comes to merging code into the main branch, so please understand that we may reject pull requests that do not meet the project's standards. It's never personal. Also, game-related scripts have a lower chance of being merged.

Description

This pull request includes several changes to the InstallMethod component in the JSON editor to enhance functionality and improve code organization. Key changes include the addition of input references, updating the OS handling logic, and the introduction of a new OperatingSystems configuration.

Enhancements to InstallMethod Component:

  • Added references for CPU, RAM, and HDD input fields using useRef to manage input elements (frontend/src/app/json-editor/_components/InstallMethod.tsx).
  • Updated updateInstallMethod function to handle Alpine OS-specific logic, resetting the version when the OS is set to Alpine (frontend/src/app/json-editor/_components/InstallMethod.tsx).
  • Replaced ResourceInput components with Input components, adding references for better input management (frontend/src/app/json-editor/_components/InstallMethod.tsx).

Configuration Updates:

  • Introduced OperatingSystems configuration in siteConfig to define supported operating systems and their versions (frontend/src/config/siteConfig.tsx).

Type Definitions:

  • Added new type definitions for OperatingSystem and Version to support the OperatingSystems configuration (frontend/src/lib/types.ts).

Fixes #389

Type of change

Please check the relevant option(s):

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would cause existing functionality to change unexpectedly)
  • New script (a fully functional and thoroughly tested script or set of scripts.)

Prerequisites

The following efforts must be made for the PR to be considered. Please check when completed:

  • Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions)
  • Testing performed (I have tested my changes, ensuring everything works as expected)
  • Documentation updated (I have updated any relevant documentation)

Additional Information (optional)

Provide any additional context or screenshots about the feature or fix here.

If there are other pull requests or discussions related to this change, please link them here:

  • Related PR #

🔄 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/426 **Author:** [@BramSuurdje](https://github.com/BramSuurdje) **Created:** 11/22/2024 **Status:** ✅ Merged **Merged:** 11/23/2024 **Merged by:** [@MickLesk](https://github.com/MickLesk) **Base:** `main` ← **Head:** `fix-json-page-numbering` --- ### 📝 Commits (1) - [`0f64190`](https://github.com/community-scripts/ProxmoxVE/commit/0f641909a25b1c422a9ec423311ab39fc527eb1e) Enhance InstallMethod component: add operating system selection and version handling with new input structure ### 📊 Changes **3 files changed** (+138 additions, -81 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/app/json-editor/_components/InstallMethod.tsx` (+109 -80) 📝 `frontend/src/config/siteConfig.tsx` (+19 -1) 📝 `frontend/src/lib/types.ts` (+10 -0) </details> ### 📄 Description …ersion handling with new input structure > [!NOTE] > We are meticulous when it comes to merging code into the main branch, so please understand that we may reject pull requests that do not meet the project's standards. It's never personal. Also, game-related scripts have a lower chance of being merged. ## Description This pull request includes several changes to the `InstallMethod` component in the JSON editor to enhance functionality and improve code organization. Key changes include the addition of input references, updating the OS handling logic, and the introduction of a new `OperatingSystems` configuration. ### Enhancements to `InstallMethod` Component: * Added references for CPU, RAM, and HDD input fields using `useRef` to manage input elements (`frontend/src/app/json-editor/_components/InstallMethod.tsx`). * Updated `updateInstallMethod` function to handle Alpine OS-specific logic, resetting the version when the OS is set to Alpine (`frontend/src/app/json-editor/_components/InstallMethod.tsx`). * Replaced `ResourceInput` components with `Input` components, adding references for better input management (`frontend/src/app/json-editor/_components/InstallMethod.tsx`). ### Configuration Updates: * Introduced `OperatingSystems` configuration in `siteConfig` to define supported operating systems and their versions (`frontend/src/config/siteConfig.tsx`). ### Type Definitions: * Added new type definitions for `OperatingSystem` and `Version` to support the `OperatingSystems` configuration (`frontend/src/lib/types.ts`). Fixes #389 ## Type of change Please check the relevant option(s): - [x] Bug fix (non-breaking change that resolves an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (a fix or feature that would cause existing functionality to change unexpectedly) - [ ] New script (a fully functional and thoroughly tested script or set of scripts.) ## Prerequisites The following efforts must be made for the PR to be considered. Please check when completed: - [x] Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions) - [x] Testing performed (I have tested my changes, ensuring everything works as expected) - [ ] Documentation updated (I have updated any relevant documentation) ## Additional Information (optional) Provide any additional context or screenshots about the feature or fix here. ## Related Pull Requests / Discussions If there are other pull requests or discussions related to this change, please link them here: - Related PR # --- <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 05:30:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#2524