feat(agents): concurrent all-agent-driver upgrade

This commit is contained in:
Abeautifulsnow authored and GitHub committed 2026-07-24 23:50:50 +08:00
1 parent 2a99f91099
commit 95db01e359
15 files changed
+1083 -282

No files matched your search

+10 -7
View File
@@ -95,25 +95,28 @@ export const clearDriverDownloadCache = forward("clearDriverDownloadCache");
export const getDriverRuntimeSummary = forward("getDriverRuntimeSummary");
export const stopDriverRuntime = forward("stopDriverRuntime");
export const restartDriverRuntime = forward("restartDriverRuntime");
export async function installAgent(dbType: string) {
export async function installAgent(dbType: string, operationId?: string) {
const backend = await getBackend();
return backend.installAgent(dbType, useSettingsStore().editorSettings.updateDownloadSource);
return backend.installAgent(dbType, useSettingsStore().editorSettings.updateDownloadSource, operationId);
}
export async function upgradeAllAgents() {
export async function upgradeAllAgents(operationId?: string) {
const backend = await getBackend();
return backend.upgradeAllAgents(useSettingsStore().editorSettings.updateDownloadSource);
return backend.upgradeAllAgents(useSettingsStore().editorSettings.updateDownloadSource, operationId);
}
export const checkAgentUpdateBlockers = forward("checkAgentUpdateBlockers");
export const uninstallAgent = forward("uninstallAgent");
export const getAgentJavaRuntimeConfig = forward("getAgentJavaRuntimeConfig");
export const setAgentJavaRuntimeConfig = forward("setAgentJavaRuntimeConfig");
export const invalidateAgentRegistryCache = forward("invalidateAgentRegistryCache");
export const importAgentsFromZip = forward("importAgentsFromZip");
export async function importAgentsFromZip(fileOrPath: string | File, operationId?: string) {
const backend = await getBackend();
return backend.importAgentsFromZip(fileOrPath, operationId);
}
export const importAgentDriver = forward("importAgentDriver");
export const importAgentJar = importAgentDriver;
export async function reinstallJre(jreKey?: string) {
export async function reinstallJre(jreKey?: string, operationId?: string) {
const backend = await getBackend();
return backend.reinstallJre(jreKey, useSettingsStore().editorSettings.updateDownloadSource);
return backend.reinstallJre(jreKey, useSettingsStore().editorSettings.updateDownloadSource, operationId);
}
export const uninstallJre = forward("uninstallJre");
export const listenAgentInstallProgress = forward("listenAgentInstallProgress");
+8 -7
View File
@@ -437,12 +437,12 @@ export async function restartDriverRuntime(runtimeId: string): Promise<void> {
await post("/api/agents/runtime/restart", { runtimeId });
}
export async function installAgent(dbType: string, _source?: UpdateDownloadSource): Promise<void> {
await post("/api/agents/install", { dbType });
export async function installAgent(dbType: string, _source?: UpdateDownloadSource, operationId?: string): Promise<void> {
await post("/api/agents/install", { dbType, operationId });
}
export async function upgradeAllAgents(_source?: UpdateDownloadSource): Promise<UpgradeAllAgentDriversResult> {
return post("/api/agents/upgrade-all", {});
export async function upgradeAllAgents(_source?: UpdateDownloadSource, operationId?: string): Promise<UpgradeAllAgentDriversResult> {
return post("/api/agents/upgrade-all", { operationId });
}
export async function checkAgentUpdateBlockers(_dbTypes: string[]): Promise<AgentUpdateBlocker[]> {
@@ -465,11 +465,12 @@ export async function invalidateAgentRegistryCache(): Promise<void> {
await post("/api/agents/invalidate-registry-cache", {});
}
export async function importAgentsFromZip(fileOrPath: string | File): Promise<number> {
export async function importAgentsFromZip(fileOrPath: string | File, operationId?: string): Promise<number> {
if (typeof fileOrPath === "string") {
throw new Error("Offline ZIP import in web mode requires a File object, not a file path");
}
const formData = new FormData();
if (operationId) formData.append("operationId", operationId);
formData.append("file", fileOrPath);
const res = await fetch(apiUrl("/api/agents/import-offline"), { method: "POST", body: formData });
if (!res.ok) throw new Error(await res.text());
@@ -496,8 +497,8 @@ export async function importAgentDriver(dbType: string, pathOrFile: string | Fil
export const importAgentJar = importAgentDriver;
export async function reinstallJre(jreKey?: string, _source?: UpdateDownloadSource): Promise<void> {
await post("/api/agents/reinstall-jre", { jreKey });
export async function reinstallJre(jreKey?: string, _source?: UpdateDownloadSource, operationId?: string): Promise<void> {
await post("/api/agents/reinstall-jre", { jreKey, operationId });
}
export async function uninstallJre(jreKey: string): Promise<void> {
+9 -8
View File
@@ -318,6 +318,7 @@ export interface DroppedFilePreviewSqlOptions {
export type XlsxCellValue = string | number | boolean | null;
export interface DriverInstallProgress {
operation_id?: string;
step: string;
downloaded?: number;
total?: number;
@@ -1364,12 +1365,12 @@ export async function restartDriverRuntime(runtimeId: string): Promise<void> {
return invoke("restart_driver_runtime", { runtimeId });
}
export async function installAgent(dbType: string, source?: UpdateDownloadSource): Promise<void> {
return invoke("install_agent", { dbType, source });
export async function installAgent(dbType: string, source?: UpdateDownloadSource, operationId?: string): Promise<void> {
return invoke("install_agent", { dbType, source, operationId });
}
export async function upgradeAllAgents(source?: UpdateDownloadSource): Promise<UpgradeAllAgentDriversResult> {
return invoke("upgrade_all_agents", { source });
export async function upgradeAllAgents(source?: UpdateDownloadSource, operationId?: string): Promise<UpgradeAllAgentDriversResult> {
return invoke("upgrade_all_agents", { source, operationId });
}
export async function checkAgentUpdateBlockers(dbTypes: string[]): Promise<AgentUpdateBlocker[]> {
@@ -1392,11 +1393,11 @@ export async function invalidateAgentRegistryCache(): Promise<void> {
return invoke("invalidate_agent_registry_cache");
}
export async function importAgentsFromZip(path: string | File): Promise<number> {
export async function importAgentsFromZip(path: string | File, operationId?: string): Promise<number> {
if (typeof path !== "string") {
throw new Error("Desktop offline ZIP import requires a local file path");
}
return invoke("import_agents_from_zip", { path });
return invoke("import_agents_from_zip", { path, operationId });
}
export async function importAgentDriver(dbType: string, path: string | File): Promise<void> {
@@ -1408,8 +1409,8 @@ export async function importAgentDriver(dbType: string, path: string | File): Pr
export const importAgentJar = importAgentDriver;
export async function reinstallJre(jreKey?: string, source?: UpdateDownloadSource): Promise<void> {
return invoke("reinstall_jre", { jreKey, source });
export async function reinstallJre(jreKey?: string, source?: UpdateDownloadSource, operationId?: string): Promise<void> {
return invoke("reinstall_jre", { jreKey, source, operationId });
}
export async function uninstallJre(jreKey: string): Promise<void> {