Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dashboard/src/i18n/locales/en-US/features/extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -217,4 +222,4 @@
"pluginChangelog": {
"menuTitle": "View Changelog"
}
}
}
7 changes: 6 additions & 1 deletion dashboard/src/i18n/locales/zh-CN/features/extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@
"title": "未检测到新版本",
"message": "当前插件未检测到新版本,是否强制重新安装?这将从远程仓库拉取最新代码。",
"confirm": "强制更新"
},
"updateAllConfirm": {
"title": "确认更新全部插件",
"message": "确定要更新全部 {count} 个插件吗?此操作可能需要一些时间。",
"confirm": "确认更新"
}
},
"messages": {
Expand Down Expand Up @@ -217,4 +222,4 @@
"pluginChangelog": {
"menuTitle": "查看更新日志"
}
}
}
52 changes: 51 additions & 1 deletion dashboard/src/views/ExtensionPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ const forceUpdateDialog = reactive({
extensionName: "",
});

// 更新全部插件确认对话框
const updateAllConfirmDialog = reactive({
show: false,
});

// 插件更新日志对话框(复用 ReadmeDialog)
const changelogDialog = reactive({
show: false,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1128,7 +1150,7 @@ watch(isListView, (newVal) => {
variant="tonal"
:disabled="updatableExtensions.length === 0"
:loading="updatingAll"
@click="updateAllExtensions"
@click="showUpdateAllConfirm"
>
<v-icon>mdi-update</v-icon>
{{ tm("buttons.updateAll") }}
Expand Down Expand Up @@ -2279,6 +2301,34 @@ watch(isListView, (newVal) => {
@confirm="handleUninstallConfirm"
/>

<!-- 更新全部插件确认对话框 -->
<v-dialog v-model="updateAllConfirmDialog.show" max-width="420">
<v-card class="rounded-lg">
<v-card-title class="d-flex align-center pa-4">
<v-icon color="warning" class="mr-2">mdi-update</v-icon>
{{ tm("dialogs.updateAllConfirm.title") }}
</v-card-title>
<v-card-text>
<p class="text-body-1">
{{ tm("dialogs.updateAllConfirm.message", { count: updatableExtensions.length }) }}
</p>
</v-card-text>
<v-card-actions class="pa-4">
<v-spacer></v-spacer>
<v-btn
variant="text"
@click="cancelUpdateAll"
>{{ tm("buttons.cancel") }}</v-btn>
<v-btn
color="warning"
variant="flat"
@click="confirmUpdateAll"
>{{ tm("dialogs.updateAllConfirm.confirm") }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>


<!-- 指令冲突提示对话框 -->
<v-dialog v-model="conflictDialog.show" max-width="420">
<v-card class="rounded-lg">
Expand Down