[PR #156] [MERGED] Frontend: Use static assets instead of fetching json from github #2616

Closed
opened 2026-02-26 13:30:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/156
Author: @havardthom
Created: 11/9/2024
Status: Merged
Merged: 11/9/2024
Merged by: @havardthom

Base: mainHead: frontend-assets


📝 Commits (1)

  • 5ad9b8b Use static assets instead of fetching from github

📊 Changes

18 files changed (+135 additions, -106 deletions)

View changed files

frontend/public/json (+1 -0)
📝 frontend/src/app/api/categories/route.ts (+32 -21)
📝 frontend/src/app/layout.tsx (+2 -3)
📝 frontend/src/app/page.tsx (+11 -4)
📝 frontend/src/app/scripts/_components/ScriptItem.tsx (+3 -1)
📝 frontend/src/app/scripts/_components/ScriptItems/DefaultPassword.tsx (+11 -4)
📝 frontend/src/app/scripts/_components/ScriptItems/DefaultSettings.tsx (+2 -1)
📝 frontend/src/app/scripts/_components/ScriptItems/InstallCommand.tsx (+5 -3)
📝 frontend/src/app/scripts/_components/ScriptItems/InterFaces.tsx (+10 -9)
📝 frontend/src/app/scripts/_components/Sidebar.tsx (+6 -5)
📝 frontend/src/components/ui/codeblock.tsx (+2 -2)
📝 frontend/src/components/ui/navigation-menu.tsx (+1 -1)
📝 frontend/src/components/ui/star-on-github-button.tsx (+8 -5)
📝 frontend/src/components/ui/theme-toggle.tsx (+7 -2)
📝 frontend/src/config/siteConfig.tsx (+2 -2)
📝 frontend/src/lib/data.ts (+6 -19)
📝 frontend/src/lib/types.ts (+10 -8)
📝 json/metadata.json (+16 -16)

📄 Description

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

  • Adds json files as static assets to frontend by creating a symbolic link /json -> /frontend/public/json
  • Reads json files from static assets instead of fetching them from github
  • Update sort_order in metadata.json and use it instead of overriding in frontend
  • Ran linting which also changed some unrelated files (should probably add an action that checks linting). My changes are in json/metadata.json, frontend/src/lib/data.ts and frontend/src/app/api/categories/route.ts

Tested that the website works on my fork github pages

Some benefits:

  • (very) Small performance increase
  • Better for development since frontend will use local json files
  • Fixes github rate limit exceeded error

Fixes https://github.com/community-scripts/ProxmoxVE/issues/155

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.

image

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/156 **Author:** [@havardthom](https://github.com/havardthom) **Created:** 11/9/2024 **Status:** ✅ Merged **Merged:** 11/9/2024 **Merged by:** [@havardthom](https://github.com/havardthom) **Base:** `main` ← **Head:** `frontend-assets` --- ### 📝 Commits (1) - [`5ad9b8b`](https://github.com/community-scripts/ProxmoxVE/commit/5ad9b8b0acc45feed875389b9559a2e4d6eb01a9) Use static assets instead of fetching from github ### 📊 Changes **18 files changed** (+135 additions, -106 deletions) <details> <summary>View changed files</summary> ➕ `frontend/public/json` (+1 -0) 📝 `frontend/src/app/api/categories/route.ts` (+32 -21) 📝 `frontend/src/app/layout.tsx` (+2 -3) 📝 `frontend/src/app/page.tsx` (+11 -4) 📝 `frontend/src/app/scripts/_components/ScriptItem.tsx` (+3 -1) 📝 `frontend/src/app/scripts/_components/ScriptItems/DefaultPassword.tsx` (+11 -4) 📝 `frontend/src/app/scripts/_components/ScriptItems/DefaultSettings.tsx` (+2 -1) 📝 `frontend/src/app/scripts/_components/ScriptItems/InstallCommand.tsx` (+5 -3) 📝 `frontend/src/app/scripts/_components/ScriptItems/InterFaces.tsx` (+10 -9) 📝 `frontend/src/app/scripts/_components/Sidebar.tsx` (+6 -5) 📝 `frontend/src/components/ui/codeblock.tsx` (+2 -2) 📝 `frontend/src/components/ui/navigation-menu.tsx` (+1 -1) 📝 `frontend/src/components/ui/star-on-github-button.tsx` (+8 -5) 📝 `frontend/src/components/ui/theme-toggle.tsx` (+7 -2) 📝 `frontend/src/config/siteConfig.tsx` (+2 -2) 📝 `frontend/src/lib/data.ts` (+6 -19) 📝 `frontend/src/lib/types.ts` (+10 -8) 📝 `json/metadata.json` (+16 -16) </details> ### 📄 Description > [!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 - Adds json files as static assets to frontend by creating a symbolic link `/json` -> `/frontend/public/json` - Reads json files from static assets instead of fetching them from github - Update `sort_order` in `metadata.json` and use it instead of overriding in frontend - Ran linting which also changed some unrelated files (should probably add an action that checks linting). My changes are in `json/metadata.json`, `frontend/src/lib/data.ts` and `frontend/src/app/api/categories/route.ts` Tested that the website works on my fork github pages Some benefits: - (very) Small performance increase - Better for development since frontend will use local json files - Fixes github rate limit exceeded error Fixes https://github.com/community-scripts/ProxmoxVE/issues/155 ## Type of change Please check the relevant option(s): - [x] Bug fix (non-breaking change that resolves an issue) - [x] 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) - [x] Documentation updated (I have updated any relevant documentation) ## Additional Information (optional) Provide any additional context or screenshots about the feature or fix here. ![image](https://github.com/user-attachments/assets/afbdeeea-37dd-4114-b41f-a818ef69242e) ## 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>
kerem 2026-02-26 13:30:48 +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#2616
No description provided.