perf: race GitHub proxies concurrently for driver downloads and registry fetch

Replace sequential proxy fallback (up to 30s worst-case) with concurrent
racing via futures::select_ok, returning the first successful response.
Add list_installed_agents_local command for instant UI rendering with
async registry update. Fix missing useToast import in RedisValueViewer.
This commit is contained in:
t8y2
2026-05-13 14:18:28 +08:00
parent 321ebc2636
commit fa0dfc9383
7 changed files with 121 additions and 128 deletions
+11 -1
View File
@@ -238,7 +238,17 @@ async function deleteJdbcDriver(path: string) {
// ──────────── Lifecycle ────────────
onMounted(async () => {
await refreshAgents();
const [jre, localDrivers] = await Promise.all([
invoke<boolean>("check_jre_installed"),
invoke<AgentDriverInfo[]>("list_installed_agents_local"),
]);
jreInstalled.value = jre;
drivers.value = localDrivers;
invoke<AgentDriverInfo[]>("list_installed_agents").then((result) => {
drivers.value = result;
});
unlisten = await listen<InstallProgress>("agent-install-progress", (event) => {
if (event.payload.step === "done") {
progress.value = null;
@@ -9,6 +9,7 @@ import { Sheet, SheetContent, SheetFooter, SheetHeader, SheetTitle } from "@/com
import DangerConfirmDialog from "@/components/editor/DangerConfirmDialog.vue";
import * as api from "@/lib/api";
import type { RedisValue } from "@/lib/api";
import { useToast } from "@/composables/useToast";
import {
canEditRedisMemberDetail,
clampRedisMemberDetailSheetWidth,
@@ -18,6 +19,7 @@ import {
} from "@/lib/redisValuePresentation";
const { t } = useI18n();
const { toast } = useToast();
const props = defineProps<{
connectionId: string;