diff --git a/dashboard/src/i18n/locales/en-US/features/extension.json b/dashboard/src/i18n/locales/en-US/features/extension.json index c9b325b7c..da1766346 100644 --- a/dashboard/src/i18n/locales/en-US/features/extension.json +++ b/dashboard/src/i18n/locales/en-US/features/extension.json @@ -151,6 +151,11 @@ "title": "No New Version Detected", "message": "No new version detected for this plugin. Do you want to force reinstall? This will pull the latest code from the remote repository.", "confirm": "Force Update" + }, + "updateAllConfirm": { + "title": "Confirm Update All Plugins", + "message": "Are you sure you want to update all {count} plugins? This operation may take some time.", + "confirm": "Confirm Update" } }, "messages": { @@ -217,4 +222,4 @@ "pluginChangelog": { "menuTitle": "View Changelog" } -} +} \ No newline at end of file diff --git a/dashboard/src/i18n/locales/zh-CN/features/extension.json b/dashboard/src/i18n/locales/zh-CN/features/extension.json index 67649492e..d1365d31e 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/extension.json +++ b/dashboard/src/i18n/locales/zh-CN/features/extension.json @@ -151,6 +151,11 @@ "title": "未检测到新版本", "message": "当前插件未检测到新版本,是否强制重新安装?这将从远程仓库拉取最新代码。", "confirm": "强制更新" + }, + "updateAllConfirm": { + "title": "确认更新全部插件", + "message": "确定要更新全部 {count} 个插件吗?此操作可能需要一些时间。", + "confirm": "确认更新" } }, "messages": { @@ -217,4 +222,4 @@ "pluginChangelog": { "menuTitle": "查看更新日志" } -} +} \ No newline at end of file diff --git a/dashboard/src/views/ExtensionPage.vue b/dashboard/src/views/ExtensionPage.vue index c84862f2d..a549342f4 100644 --- a/dashboard/src/views/ExtensionPage.vue +++ b/dashboard/src/views/ExtensionPage.vue @@ -92,6 +92,11 @@ const forceUpdateDialog = reactive({ extensionName: "", }); +// 更新全部插件确认对话框 +const updateAllConfirmDialog = reactive({ + show: false, +}); + // 插件更新日志对话框(复用 ReadmeDialog) const changelogDialog = reactive({ show: false, @@ -471,6 +476,23 @@ const updateExtension = async (extension_name, forceUpdate = false) => { }; // 确认强制更新 +// 显示更新全部插件确认对话框 +const showUpdateAllConfirm = () => { + if (updatableExtensions.value.length === 0) return; + updateAllConfirmDialog.show = true; +}; + +// 确认更新全部插件 +const confirmUpdateAll = () => { + updateAllConfirmDialog.show = false; + updateAllExtensions(); +}; + +// 取消更新全部插件 +const cancelUpdateAll = () => { + updateAllConfirmDialog.show = false; +}; + const confirmForceUpdate = () => { const name = forceUpdateDialog.extensionName; forceUpdateDialog.show = false; @@ -1128,7 +1150,7 @@ watch(isListView, (newVal) => { variant="tonal" :disabled="updatableExtensions.length === 0" :loading="updatingAll" - @click="updateAllExtensions" + @click="showUpdateAllConfirm" > mdi-update {{ tm("buttons.updateAll") }} @@ -2279,6 +2301,34 @@ watch(isListView, (newVal) => { @confirm="handleUninstallConfirm" /> + + + + + mdi-update + {{ tm("dialogs.updateAllConfirm.title") }} + + + + {{ tm("dialogs.updateAllConfirm.message", { count: updatableExtensions.length }) }} + + + + + {{ tm("buttons.cancel") }} + {{ tm("dialogs.updateAllConfirm.confirm") }} + + + + +
+ {{ tm("dialogs.updateAllConfirm.message", { count: updatableExtensions.length }) }} +