fix(drivers): skip blocked driver updates

This commit is contained in:
t8y2 committed 2026-06-03 14:39:46 +08:00
1 parent 381bdfdfd7
commit 7fb53ee0b4
14 files changed
+299 -15

No files matched your search

@@ -212,6 +212,11 @@ async function runDriverInstall(dbType: string) {
installing.value = dbType;
progress.value = null;
try {
const blockers = await api.checkAgentUpdateBlockers([dbType]);
if (blockers.length > 0) {
toast(t("driverStore.driverUpdateBlocked", { labels: blockers.map((blocker) => blocker.label).join(", ") }));
return;
}
await api.installAgent(dbType);
await refreshAgents();
toast(t("driverStore.driverInstallSuccess", { label }));
@@ -239,9 +244,22 @@ async function upgradeAll() {
queuedDriverInstalls.value = [];
progress.value = null;
try {
const count = await api.upgradeAllAgents();
const updatableDbTypes = drivers.value.filter((driver) => driver.update_available).map((driver) => driver.db_type);
const blockers = await api.checkAgentUpdateBlockers(updatableDbTypes);
if (blockers.length > 0) {
toast(t("driverStore.driverUpdateBlocked", { labels: blockers.map((blocker) => blocker.label).join(", ") }));
return;
}
const result = await api.upgradeAllAgents();
await refreshAgents();
toast(t("driverStore.upgradeAllSuccess", { count }));
if (result.failed.length > 0) {
const failedLabels = result.failed
.map((item) => drivers.value.find((driver) => driver.db_type === item.db_type)?.label ?? item.db_type)
.join(", ");
toast(t("driverStore.upgradeAllPartial", { count: result.upgraded, failed: failedLabels }));
} else {
toast(t("driverStore.upgradeAllSuccess", { count: result.upgraded }));
}
} catch (e: any) {
toast(t("driverStore.upgradeAllFailed", { error: e }));
} finally {