refactor(desktop): organize lib modules by domain

This commit is contained in:
t8y2 committed 2026-07-04 13:53:52 +08:00
1 parent 90f0594e93
commit 7e7c4944e9
700 files changed
+1292 -1264

No files matched your search

@@ -0,0 +1,17 @@
import type { SqlFileProgress } from "@/lib/backend/tauri";
import { apiUrl } from "@/lib/common/webPath";
export function listenSqlFileProgressById(executionId: string, handler: (progress: SqlFileProgress) => void): () => void {
const es = new EventSource(apiUrl(`/api/sql-file/progress/${executionId}`));
es.onmessage = (e) => {
const progress: SqlFileProgress = JSON.parse(e.data);
handler(progress);
if (progress.status === "done" || progress.status === "error" || progress.status === "cancelled") {
es.close();
}
};
es.onerror = () => {
es.close();
};
return () => es.close();
}