From b0f5751e1129f23260e6e6353e9770847b4ba9fc Mon Sep 17 00:00:00 2001
From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com>
Date: Thu, 13 Mar 2025 12:17:36 +0900
Subject: [PATCH] [Update/Refactor] Fetch and show the plugins info list.
Refactor some functions. Try to fetch functions from github api just once
when vrct started.(It used to every time plugin tab has opened so easy to
reach to the api limit)
---
package-lock.json | 8 +-
src-ui/app/App.jsx | 2 +-
.../_app_controllers/PluginsController.jsx | 17 +-
.../_download_button/_DownloadButton.jsx | 41 ++++
.../_DownloadButton.module.scss | 30 +++
.../download_models/DownloadModels.jsx | 46 +---
.../DownloadModels.module.scss | 30 ---
.../download_plugins/DownloadPlugins.jsx | 33 +++
.../DownloadPlugins.module.scss | 0
.../setting_box/_components/index.js | 3 +-
.../setting_box/plugins/Plugins.jsx | 202 ++++++------------
.../setting_box/plugins/Plugins.module.scss | 30 +++
.../app/main_page/main_section/PluginHost.jsx | 6 +-
src-ui/logics/common/index.js | 3 +-
src-ui/logics/common/useFetch.js | 21 ++
src-ui/logics/configs/plugins/usePlugins.js | 113 ++++++++--
src-ui/store.js | 2 +-
17 files changed, 350 insertions(+), 237 deletions(-)
create mode 100644 src-ui/app/config_page/setting_section/setting_box/_components/_atoms/_download_button/_DownloadButton.jsx
create mode 100644 src-ui/app/config_page/setting_section/setting_box/_components/_atoms/_download_button/_DownloadButton.module.scss
create mode 100644 src-ui/app/config_page/setting_section/setting_box/_components/download_plugins/DownloadPlugins.jsx
create mode 100644 src-ui/app/config_page/setting_section/setting_box/_components/download_plugins/DownloadPlugins.module.scss
create mode 100644 src-ui/logics/common/useFetch.js
diff --git a/package-lock.json b/package-lock.json
index 6cb00da1..62bd3e7f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,7 +8,7 @@
"name": "tauri-app",
"version": "0.0.0",
"dependencies": {
- "@babel/standalone": "^7.26.9",
+ "@babel/standalone": "7.26.9",
"@emotion/react": "11.14.0",
"@emotion/styled": "11.14.0",
"@mui/material": "6.2.0",
@@ -21,18 +21,18 @@
"jotai": "2.10.3",
"js-base64": "3.7.7",
"js-yaml": "4.1.0",
- "jszip": "^3.10.1",
+ "jszip": "3.10.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-i18next": "15.2.0",
"react-resizable-layout": "0.7.2",
- "semver": "^7.7.1"
+ "semver": "7.7.1"
},
"devDependencies": {
"@tauri-apps/cli": "1.6.3",
"npm-run-all": "4.1.5",
"sass": "1.79.4",
- "vite": "^6.2.1",
+ "vite": "6.2.1",
"vite-plugin-svgr": "4.3.0"
}
},
diff --git a/src-ui/app/App.jsx b/src-ui/app/App.jsx
index fe4f5745..22c5107c 100644
--- a/src-ui/app/App.jsx
+++ b/src-ui/app/App.jsx
@@ -41,7 +41,6 @@ export const App = () => {
{`${Math.round(option.progress)}%`}
+ > + ); + case option.is_pending: + return{`${Math.round(option.progress)}%`}
- > - ); - case option.is_pending: - return{plugin.title}
+{plugin.plugin_id}
{plugin.error ? (Error: {plugin.error}
) : ( - <> -Version: {plugin.plugin_version}
-- Compatible: {plugin.min_compatible_version} ~ {plugin.max_compatible_version} -
- - {download_progress[plugin.plugin_id] !== undefined && ( -Version: {plugin.plugin_version}
++ Compatible: {plugin.min_supported_vrct_version} ~ {plugin.max_supported_vrct_version} +
+