From c7691992ecfcaab6eda0d9d5c174954405dcf5ed Mon Sep 17 00:00:00 2001
From: 25juan <1216181067@qq.com>
Date: Sat, 10 Jan 2026 21:59:22 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E6=8F=92=E4=BB=B6=E5=B8=82=E5=9C=BA):=20?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8F=92=E4=BB=B6?=
=?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
新增本地插件导入功能,支持通过本地文件或远程URL导入插件配置。添加了新的路由、页面组件及多语言支持,并扩展了插件存储逻辑以区分本地插件。同时更新了Ant Design组件注册以支持新功能所需的UI组件。
---
detach/package.json | 5 +-
feature/package.json | 5 +-
feature/src/App.vue | 8 +
feature/src/languages/langs/en-US.ts | 23 ++
feature/src/languages/langs/zh-CN.ts | 22 ++
feature/src/main.ts | 6 +
feature/src/router/index.ts | 6 +
feature/src/store/index.ts | 21 +-
feature/src/views/market/components/image.vue | 1 +
.../views/market/components/local-plugin.vue | 196 ++++++++++++++++++
guide/package.json | 5 +-
package.json | 3 +
12 files changed, 296 insertions(+), 5 deletions(-)
create mode 100644 feature/src/views/market/components/local-plugin.vue
diff --git a/detach/package.json b/detach/package.json
index de70349..a724335 100644
--- a/detach/package.json
+++ b/detach/package.json
@@ -53,5 +53,8 @@
"> 1%",
"last 2 versions",
"not dead"
- ]
+ ],
+ "volta": {
+ "node": "16.20.2"
+ }
}
diff --git a/feature/package.json b/feature/package.json
index 56597ef..97a6ba2 100644
--- a/feature/package.json
+++ b/feature/package.json
@@ -67,5 +67,8 @@
"> 1%",
"last 2 versions",
"not dead"
- ]
+ ],
+ "volta": {
+ "node": "16.20.2"
+ }
}
diff --git a/feature/src/App.vue b/feature/src/App.vue
index 7919062..4a2ed21 100644
--- a/feature/src/App.vue
+++ b/feature/src/App.vue
@@ -42,6 +42,12 @@
{{ $t('feature.market.systemTool') }}
+
+
+
+
+ {{ $t('feature.market.localPlugin') }}
+
@@ -82,6 +88,7 @@
'tools',
'worker',
'system',
+ 'localPlugin',
].includes(active[0])
? 'container'
: 'more'
@@ -107,6 +114,7 @@ import {
SettingOutlined,
HeartOutlined,
BugOutlined,
+ ApiOutlined,
} from '@ant-design/icons-vue';
import { useStore } from 'vuex';
import localConfig from '@/confOp';
diff --git a/feature/src/languages/langs/en-US.ts b/feature/src/languages/langs/en-US.ts
index 07246b8..1be8ebc 100644
--- a/feature/src/languages/langs/en-US.ts
+++ b/feature/src/languages/langs/en-US.ts
@@ -11,6 +11,7 @@ export default {
imageTool: 'Image Tools',
developTool: 'Develop Tools',
systemTool: 'System Tools',
+ localPlugin: 'Custom Plugins',
finder: {
must: 'Necessary',
recommended: 'Recommended',
@@ -114,6 +115,28 @@ export default {
installSuccess: '{pluginName} Install Successed!',
refreshSuccess: '{pluginName} Refresh Successed!',
},
+ localPlugin: {
+ title: 'Import Local Plugin',
+ okText: 'Import',
+ cancelText: 'Cancel',
+ importType: 'Import Type',
+ localImport: 'Local Import',
+ remoteImport: 'Remote Import',
+ importUrl: 'Import Url',
+ importUrlPlaceholder:
+ 'Please input remote plugin config file url. Refer to the address below',
+ importFile: 'Import File',
+ importFileErrorMsg: 'Please select the plugin config file to import',
+ importUrlErrorMsg:
+ 'Please input the correct remote plugin config file url',
+ configFetchSuccess: 'Plugin config file import success',
+ deleteLocalPluginSuccess: 'Plugin delete success',
+ deleteLocalPluginButton: 'Delete Plugin',
+ deleteLocalPluginConfirm: 'Confirm Delete Plugin',
+ deleteLocalPluginConfirmText: 'Confirm',
+ deleteLocalPluginCancelText: 'Cancel',
+ tips: 'Local Import and Remote Import both only support importing Json format configuration files. The specific content of the Json file can refer to the link: https://gitee.com/monkeyWang/rubickdatabase/raw/master/plugins/total-plugins.json',
+ },
},
},
};
diff --git a/feature/src/languages/langs/zh-CN.ts b/feature/src/languages/langs/zh-CN.ts
index 0abc51e..a955ddb 100644
--- a/feature/src/languages/langs/zh-CN.ts
+++ b/feature/src/languages/langs/zh-CN.ts
@@ -11,6 +11,8 @@ export default {
imageTool: '图像',
developTool: '开发者',
systemTool: '系统',
+ localPlugin: '自定义插件',
+
finder: {
must: '必备',
recommended: '推荐',
@@ -112,6 +114,26 @@ export default {
installSuccess: '{pluginName}安装成功!',
refreshSuccess: '{pluginName}刷新成功!',
},
+ localPlugin: {
+ title: '导入配置文件',
+ okText: '导入',
+ cancelText: '关闭',
+ importType: '导入方式',
+ localImport: '本地导入',
+ remoteImport: '远程导入',
+ importUrl: '导入地址',
+ importUrlPlaceholder: '请输入远程插件配置文件地址。参考下面的地址',
+ importFile: '导入文件',
+ importFileErrorMsg: '请选择要导入的插件配置文件',
+ importUrlErrorMsg: '请输入正确的远程插件配置文件地址',
+ configFetchSuccess: '插件配置文件导入成功',
+ deleteLocalPluginSuccess: '插件删除成功',
+ deleteLocalPluginButton: '删除插件',
+ deleteLocalPluginConfirm: '确认删除插件',
+ deleteLocalPluginConfirmText: '确认',
+ deleteLocalPluginCancelText: '取消',
+ tips: '本地导入和远程导入都只支持导入Json 格式的配置文件。Json 文件的具体内容参考链接: https://gitee.com/monkeyWang/rubickdatabase/raw/master/plugins/total-plugins.json',
+ },
},
},
};
diff --git a/feature/src/main.ts b/feature/src/main.ts
index 30c7015..e57b7d6 100644
--- a/feature/src/main.ts
+++ b/feature/src/main.ts
@@ -11,15 +11,18 @@ import {
Form,
Input,
Radio,
+ Typography,
Select,
Switch,
Avatar,
+ Popconfirm,
Collapse,
List,
Tooltip,
Alert,
Drawer,
Modal,
+ Upload,
Result,
Spin,
} from 'ant-design-vue';
@@ -73,6 +76,9 @@ createApp(App)
.use(Modal)
.use(Result)
.use(Spin)
+ .use(Upload)
+ .use(Popconfirm)
+ .use(Typography)
.use(router)
.use(Vue3Lottie)
.mount('#app');
diff --git a/feature/src/router/index.ts b/feature/src/router/index.ts
index 6405606..1eceb10 100644
--- a/feature/src/router/index.ts
+++ b/feature/src/router/index.ts
@@ -31,6 +31,11 @@ const routes: Array = [
name: 'system',
component: () => import('../views/market/components/system.vue'),
},
+ {
+ path: '/localPlugin',
+ name: 'localPlugin',
+ component: () => import('../views/market/components/local-plugin.vue'),
+ },
{
path: '/finder',
name: 'finder',
@@ -56,6 +61,7 @@ const routes: Array = [
name: 'dev',
component: () => import('../views/dev/index.vue'),
},
+
{
path: '/:catchAll(.*)',
name: 'finder',
diff --git a/feature/src/store/index.ts b/feature/src/store/index.ts
index 7bf7325..7b89fd5 100644
--- a/feature/src/store/index.ts
+++ b/feature/src/store/index.ts
@@ -11,7 +11,7 @@ const isDownload = (item: Market.Plugin, targets: any[]) => {
});
return isDownload;
};
-
+const LOCAL_PLUGIN_JSON = 'localPluginJson';
export default createStore({
state: {
totalPlugins: [],
@@ -30,8 +30,25 @@ export default createStore({
},
},
actions: {
+ async saveLocalPlugins({ dispatch, state }, plugins) {
+ // 先移除
+ window.rubick.db.remove(LOCAL_PLUGIN_JSON);
+ window.rubick.db.put({
+ _id: LOCAL_PLUGIN_JSON,
+ data: JSON.stringify(plugins),
+ });
+ await dispatch('init');
+ },
+ async deleteLocalPlugins({ dispatch, state }) {
+ // 先移除
+ window.rubick.db.remove(LOCAL_PLUGIN_JSON);
+ await dispatch('init');
+ },
async init({ commit }) {
- const totalPlugins = await request.getTotalPlugins();
+ const tPlugins = await request.getTotalPlugins();
+ const lTPlugins = window.rubick.db.get(LOCAL_PLUGIN_JSON);
+ const totalPlugins = tPlugins.concat(JSON.parse(lTPlugins?.data || '[]'));
+
const localPlugins = window.market.getLocalPlugins();
totalPlugins.forEach((origin: Market.Plugin) => {
diff --git a/feature/src/views/market/components/image.vue b/feature/src/views/market/components/image.vue
index 7dc7327..21fec40 100644
--- a/feature/src/views/market/components/image.vue
+++ b/feature/src/views/market/components/image.vue
@@ -22,6 +22,7 @@ const data = ref([]);
onBeforeMount(async () => {
data.value = await request.getImageDetail();
+ console.log(data.value);
});
const system = computed(() => {
diff --git a/feature/src/views/market/components/local-plugin.vue b/feature/src/views/market/components/local-plugin.vue
new file mode 100644
index 0000000..4405bf3
--- /dev/null
+++ b/feature/src/views/market/components/local-plugin.vue
@@ -0,0 +1,196 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('feature.localPlugin.localImport') }}
+
+
+ {{ $t('feature.localPlugin.remoteImport') }}
+
+
+
+
+
+
+
+
+ {{ $t('feature.localPlugin.importFile') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/guide/package.json b/guide/package.json
index 65635f3..0462b0a 100644
--- a/guide/package.json
+++ b/guide/package.json
@@ -39,5 +39,8 @@
"last 2 versions",
"not dead",
"not ie 11"
- ]
+ ],
+ "volta": {
+ "node": "16.20.2"
+ }
}
diff --git a/package.json b/package.json
index 62a1557..8711c20 100644
--- a/package.json
+++ b/package.json
@@ -79,5 +79,8 @@
"resolutions": {
"vue-cli-plugin-electron-builder/electron-builder": "^23.0.3",
"leveldown": "6.0.3"
+ },
+ "volta": {
+ "node": "16.20.2"
}
}