feat(update): mirror agent release downloads
This commit is contained in:
1 parent
f4ff8b11a5
commit
fec91b9aef
10 files changed
+355
-53
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import { isTauriRuntime } from "@/lib/backend/tauriRuntime";
|
||||
import type * as TauriModule from "@/lib/backend/tauri";
|
||||
import { appendDebugLog } from "@/lib/backend/debugLog";
|
||||
import { useSettingsStore } from "@/stores/settingsStore";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Lazy backend resolution (avoids top-level await)
|
||||
@@ -76,15 +77,24 @@ export const installJdbcPlugin = forward("installJdbcPlugin");
|
||||
export const installJdbcPluginLocal = forward("installJdbcPluginLocal");
|
||||
export const uninstallJdbcPlugin = forward("uninstallJdbcPlugin");
|
||||
export const listInstalledAgentsLocal = forward("listInstalledAgentsLocal");
|
||||
export const listInstalledAgents = forward("listInstalledAgents");
|
||||
export async function listInstalledAgents() {
|
||||
const backend = await getBackend();
|
||||
return backend.listInstalledAgents(useSettingsStore().editorSettings.updateDownloadSource);
|
||||
}
|
||||
export const isAgentInstalled = forward("isAgentInstalled");
|
||||
export const getDriverStoreUsage = forward("getDriverStoreUsage");
|
||||
export const clearDriverDownloadCache = forward("clearDriverDownloadCache");
|
||||
export const getDriverRuntimeSummary = forward("getDriverRuntimeSummary");
|
||||
export const stopDriverRuntime = forward("stopDriverRuntime");
|
||||
export const restartDriverRuntime = forward("restartDriverRuntime");
|
||||
export const installAgent = forward("installAgent");
|
||||
export const upgradeAllAgents = forward("upgradeAllAgents");
|
||||
export async function installAgent(dbType: string) {
|
||||
const backend = await getBackend();
|
||||
return backend.installAgent(dbType, useSettingsStore().editorSettings.updateDownloadSource);
|
||||
}
|
||||
export async function upgradeAllAgents() {
|
||||
const backend = await getBackend();
|
||||
return backend.upgradeAllAgents(useSettingsStore().editorSettings.updateDownloadSource);
|
||||
}
|
||||
export const checkAgentUpdateBlockers = forward("checkAgentUpdateBlockers");
|
||||
export const uninstallAgent = forward("uninstallAgent");
|
||||
export const getAgentJavaRuntimeConfig = forward("getAgentJavaRuntimeConfig");
|
||||
@@ -92,7 +102,10 @@ export const setAgentJavaRuntimeConfig = forward("setAgentJavaRuntimeConfig");
|
||||
export const invalidateAgentRegistryCache = forward("invalidateAgentRegistryCache");
|
||||
export const importAgentsFromZip = forward("importAgentsFromZip");
|
||||
export const importAgentJar = forward("importAgentJar");
|
||||
export const reinstallJre = forward("reinstallJre");
|
||||
export async function reinstallJre(jreKey?: string) {
|
||||
const backend = await getBackend();
|
||||
return backend.reinstallJre(jreKey, useSettingsStore().editorSettings.updateDownloadSource);
|
||||
}
|
||||
export const uninstallJre = forward("uninstallJre");
|
||||
export const listenAgentInstallProgress = forward("listenAgentInstallProgress");
|
||||
export const loadSavedSqlLibrary = forward("loadSavedSqlLibrary");
|
||||
|
||||
@@ -342,7 +342,7 @@ export async function listInstalledAgentsLocal(): Promise<AgentDriverInfo[]> {
|
||||
return get("/api/agents/installed-local");
|
||||
}
|
||||
|
||||
export async function listInstalledAgents(): Promise<AgentDriverInfo[]> {
|
||||
export async function listInstalledAgents(_source?: UpdateDownloadSource): Promise<AgentDriverInfo[]> {
|
||||
return get("/api/agents/installed");
|
||||
}
|
||||
|
||||
@@ -370,11 +370,11 @@ export async function restartDriverRuntime(runtimeId: string): Promise<void> {
|
||||
await post("/api/agents/runtime/restart", { runtimeId });
|
||||
}
|
||||
|
||||
export async function installAgent(dbType: string): Promise<void> {
|
||||
export async function installAgent(dbType: string, _source?: UpdateDownloadSource): Promise<void> {
|
||||
await post("/api/agents/install", { dbType });
|
||||
}
|
||||
|
||||
export async function upgradeAllAgents(): Promise<UpgradeAllAgentDriversResult> {
|
||||
export async function upgradeAllAgents(_source?: UpdateDownloadSource): Promise<UpgradeAllAgentDriversResult> {
|
||||
return post("/api/agents/upgrade-all", {});
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ export async function importAgentJar(dbType: string, pathOrFile: string | File):
|
||||
if (!uploadRes.ok) throw new Error(await uploadRes.text());
|
||||
}
|
||||
|
||||
export async function reinstallJre(jreKey?: string): Promise<void> {
|
||||
export async function reinstallJre(jreKey?: string, _source?: UpdateDownloadSource): Promise<void> {
|
||||
await post("/api/agents/reinstall-jre", { jreKey });
|
||||
}
|
||||
|
||||
|
||||
@@ -1188,8 +1188,8 @@ export async function listInstalledAgentsLocal(): Promise<AgentDriverInfo[]> {
|
||||
return invoke("list_installed_agents_local");
|
||||
}
|
||||
|
||||
export async function listInstalledAgents(): Promise<AgentDriverInfo[]> {
|
||||
return invoke("list_installed_agents");
|
||||
export async function listInstalledAgents(source?: UpdateDownloadSource): Promise<AgentDriverInfo[]> {
|
||||
return invoke("list_installed_agents", { source });
|
||||
}
|
||||
|
||||
export async function isAgentInstalled(dbType: string): Promise<boolean> {
|
||||
@@ -1216,12 +1216,12 @@ export async function restartDriverRuntime(runtimeId: string): Promise<void> {
|
||||
return invoke("restart_driver_runtime", { runtimeId });
|
||||
}
|
||||
|
||||
export async function installAgent(dbType: string): Promise<void> {
|
||||
return invoke("install_agent", { dbType });
|
||||
export async function installAgent(dbType: string, source?: UpdateDownloadSource): Promise<void> {
|
||||
return invoke("install_agent", { dbType, source });
|
||||
}
|
||||
|
||||
export async function upgradeAllAgents(): Promise<UpgradeAllAgentDriversResult> {
|
||||
return invoke("upgrade_all_agents");
|
||||
export async function upgradeAllAgents(source?: UpdateDownloadSource): Promise<UpgradeAllAgentDriversResult> {
|
||||
return invoke("upgrade_all_agents", { source });
|
||||
}
|
||||
|
||||
export async function checkAgentUpdateBlockers(dbTypes: string[]): Promise<AgentUpdateBlocker[]> {
|
||||
@@ -1258,8 +1258,8 @@ export async function importAgentJar(dbType: string, path: string | File): Promi
|
||||
return invoke("import_agent_jar_cmd", { dbType, path });
|
||||
}
|
||||
|
||||
export async function reinstallJre(jreKey?: string): Promise<void> {
|
||||
return invoke("reinstall_jre", { jreKey });
|
||||
export async function reinstallJre(jreKey?: string, source?: UpdateDownloadSource): Promise<void> {
|
||||
return invoke("reinstall_jre", { jreKey, source });
|
||||
}
|
||||
|
||||
export async function uninstallJre(jreKey: string): Promise<void> {
|
||||
|
||||
Reference in new issue
Block a user