From 0ed646eb278db494c2000c2147ec4ff561fa77f5 Mon Sep 17 00:00:00 2001 From: IGCrystal Date: Mon, 23 Jun 2025 19:41:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9E=20fix(WebUI):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=AE=89=E8=A3=85=E6=8F=92=E4=BB=B6=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../locales/en-US/features/extension.json | 11 ++- .../locales/zh-CN/features/extension.json | 11 ++- dashboard/src/views/ExtensionPage.vue | 85 +++++++++++++++++-- 3 files changed, 98 insertions(+), 9 deletions(-) diff --git a/dashboard/src/i18n/locales/en-US/features/extension.json b/dashboard/src/i18n/locales/en-US/features/extension.json index 16c032596..beab264db 100644 --- a/dashboard/src/i18n/locales/en-US/features/extension.json +++ b/dashboard/src/i18n/locales/en-US/features/extension.json @@ -31,7 +31,8 @@ "saveAndClose": "Save and Close", "cancel": "Cancel", "actions": "Actions", - "back": "Back" + "back": "Back", + "selectFile": "Select File" }, "status": { "enabled": "Enabled", @@ -106,6 +107,11 @@ "uninstall": { "title": "Confirm Deletion", "message": "Are you sure you want to delete this extension?" + }, + "install": { + "title": "Install Extension", + "fromFile": "Install from File", + "fromUrl": "Install from URL" } }, "messages": { @@ -127,7 +133,8 @@ "hasUpdate": "New version available:", "confirmDelete": "Are you sure you want to delete this extension?", "fillUrlOrFile": "Please fill in extension URL or upload extension file", - "dontFillBoth": "Please don't fill in both extension URL and upload file" + "dontFillBoth": "Please don't fill in both extension URL and upload file", + "supportedFormats": "Supports .zip extension files" }, "upload": { "fromFile": "Install from File", diff --git a/dashboard/src/i18n/locales/zh-CN/features/extension.json b/dashboard/src/i18n/locales/zh-CN/features/extension.json index 1d70d795c..f83c99cd7 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/extension.json +++ b/dashboard/src/i18n/locales/zh-CN/features/extension.json @@ -31,7 +31,8 @@ "saveAndClose": "保存并关闭", "cancel": "取消", "actions": "操作", - "back": "返回" + "back": "返回", + "selectFile": "选择文件" }, "status": { "enabled": "启用", @@ -106,6 +107,11 @@ "uninstall": { "title": "删除确认", "message": "你确定要删除当前插件吗?" + }, + "install": { + "title": "安装插件", + "fromFile": "从文件安装", + "fromUrl": "从链接安装" } }, "messages": { @@ -127,7 +133,8 @@ "hasUpdate": "有新版本:", "confirmDelete": "确定要删除插件吗?", "fillUrlOrFile": "请填写插件链接或上传插件文件", - "dontFillBoth": "请不要同时填写插件链接和上传插件文件" + "dontFillBoth": "请不要同时填写插件链接和上传文件", + "supportedFormats": "支持 .zip 格式的插件文件" }, "upload": { "fromFile": "从文件安装", diff --git a/dashboard/src/views/ExtensionPage.vue b/dashboard/src/views/ExtensionPage.vue index 89f722101..aeaa6d979 100644 --- a/dashboard/src/views/ExtensionPage.vue +++ b/dashboard/src/views/ExtensionPage.vue @@ -13,6 +13,7 @@ import { ref, computed, onMounted, reactive } from 'vue'; const commonStore = useCommonStore(); const { t } = useI18n(); const { tm } = useModuleI18n('features/extension'); +const fileInput = ref(null); const activeTab = ref('installed'); const extension_data = reactive({ data: [], @@ -61,6 +62,7 @@ const loading_ = ref(false); const extension_url = ref(""); const dialog = ref(false); const upload_file = ref(null); +const uploadTab = ref('file'); const showPluginFullName = ref(false); const marketSearch = ref(""); const filterKeys = ['name', 'desc', 'author']; @@ -629,16 +631,20 @@ onMounted(async () => { - + + {{ showReserved ? 'mdi-eye-off' : 'mdi-eye' }} {{ showReserved ? tm('buttons.hideSystemPlugins') : tm('buttons.showSystemPlugins') }} - + + mdi-cog {{ tm('buttons.platformConfig') }} + + + mdi-plus + {{ tm('buttons.install') }} + @@ -1067,6 +1073,75 @@ onMounted(async () => { + + + + + {{ tm('dialogs.install.title') }} + + + {{ tm('dialogs.install.fromFile') }} + {{ tm('dialogs.install.fromUrl') }} + + + + +
+ + + + {{ tm('buttons.selectFile') }} + + +
+ {{ tm('messages.supportedFormats') }} +
+ +
+ + {{ upload_file.name }} + + +
+
+
+ + +
+ +
+
+
+
+ + + {{ tm('buttons.cancel') }} + {{ tm('buttons.install') }} + +
+