[PR #1902] [MERGED] [Website] Enhance DataFetcher with better UI components and add reactive data fetching intervals #3290

Closed
opened 2026-02-05 05:38:12 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/1902
Author: @BramSuurdje
Created: 1/31/2025
Status: Merged
Merged: 1/31/2025
Merged by: @michelroegl-brunner

Base: mainHead: shadcn-data-page


📝 Commits (1)

  • 8390298 feat: enhance DataFetcher with better UI components and add reactive data fetching intervals (#1901)

📊 Changes

3 files changed (+507 additions, -293 deletions)

View changed files

📝 frontend/src/app/data/page.tsx (+227 -194)
📝 frontend/src/components/ApplicationChart.tsx (+160 -99)
frontend/src/components/ui/table.tsx (+120 -0)

📄 Description

✍️ Description

This pull request to frontend/src/app/data/page.tsx includes significant updates to the data fetching logic, UI components, and overall code structure. The most important changes include replacing existing UI components with those from ShadCN, refactoring the data fetching logic, and improving the layout and styling of the page.

UI Components Update:

  • Replaced existing UI components with those from ShadCN, such as Button, Calendar, Card, Input, Popover, Select, and Table components.

Data Fetching Logic:

  • Refactored the fetchData function to use useCallback for better performance and moved the data fetching logic into a separate useEffect hook.
  • Added a new useEffect hook to handle the reload interval logic, including storing the interval in localStorage and clearing the interval on component unmount.

Layout and Styling Improvements:

  • Updated the layout and styling of the page to use a grid system for better responsiveness and a more modern look.
  • Improved the loading and error states with centered messages and better styling.

Additional Enhancements:

  • Simplified the status count calculation using the reduce method.
  • Replaced the pagination controls with buttons from the new UI library and improved the pagination display.


Prerequisites

The following steps must be completed for the pull request to be considered:

  • Self-review performed (I have reviewed my code to ensure it follows established patterns and conventions.)
  • Testing performed (I have thoroughly tested my changes and verified expected functionality.)

🛠️ Type of Change

Please check the relevant options:

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

📋 Additional Information (optional)

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


🔄 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/1902 **Author:** [@BramSuurdje](https://github.com/BramSuurdje) **Created:** 1/31/2025 **Status:** ✅ Merged **Merged:** 1/31/2025 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `shadcn-data-page` --- ### 📝 Commits (1) - [`8390298`](https://github.com/community-scripts/ProxmoxVE/commit/8390298d52a88ea4233003c450d9c3a7077974bf) feat: enhance DataFetcher with better UI components and add reactive data fetching intervals (#1901) ### 📊 Changes **3 files changed** (+507 additions, -293 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/app/data/page.tsx` (+227 -194) 📝 `frontend/src/components/ApplicationChart.tsx` (+160 -99) ➕ `frontend/src/components/ui/table.tsx` (+120 -0) </details> ### 📄 Description ## ✍️ Description This pull request to `frontend/src/app/data/page.tsx` includes significant updates to the data fetching logic, UI components, and overall code structure. The most important changes include replacing existing UI components with those from ShadCN, refactoring the data fetching logic, and improving the layout and styling of the page. ### UI Components Update: * Replaced existing UI components with those from ShadCN, such as `Button`, `Calendar`, `Card`, `Input`, `Popover`, `Select`, and `Table` components. ### Data Fetching Logic: * Refactored the `fetchData` function to use `useCallback` for better performance and moved the data fetching logic into a separate `useEffect` hook. * Added a new `useEffect` hook to handle the reload interval logic, including storing the interval in `localStorage` and clearing the interval on component unmount. ### Layout and Styling Improvements: * Updated the layout and styling of the page to use a grid system for better responsiveness and a more modern look. * Improved the loading and error states with centered messages and better styling. ### Additional Enhancements: * Simplified the status count calculation using the `reduce` method. * Replaced the pagination controls with buttons from the new UI library and improved the pagination display. - - - - Related Issue: #1907 - Related PR: # - Related Discussion: # - - - ## ✅ Prerequisites The following steps must be completed for the pull request to be considered: - [x] Self-review performed (I have reviewed my code to ensure it follows established patterns and conventions.) - [x] Testing performed (I have thoroughly tested my changes and verified expected functionality.) ## 🛠️ Type of Change Please check the relevant options: - [] Bug fix (non-breaking change that resolves an issue) - [] New feature (non-breaking change that adds functionality) - [] Breaking change (fix or feature that would cause existing functionality to change unexpectedly) - [] New script (a fully functional and thoroughly tested script or set of scripts) --- ## 📋 Additional Information (optional) Provide any extra context or screenshots about the feature or fix here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 05:38:12 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#3290