Fix:修复升级后固定数据标签页连接失败后无法恢复
Co-authored-by: staff <staff@qimaos-MacBook-Pro.local>
This commit is contained in:
1 parent
63d991db86
commit
7a6fc00b26
5 files changed
+83
-8
No files matched your search
@@ -21,9 +21,11 @@ const CONNECTION_ERROR_PATTERNS = [
|
||||
"agent stdout not available",
|
||||
"failed to write to agent stdin",
|
||||
"failed to flush agent stdin",
|
||||
"input/output error",
|
||||
"关闭的连接",
|
||||
"连接已关闭",
|
||||
"i/o error",
|
||||
"no route to host",
|
||||
];
|
||||
|
||||
export function staleConnectionMessage(error: unknown): string {
|
||||
@@ -37,7 +39,7 @@ export function shouldMarkDisconnected(error: unknown): boolean {
|
||||
}
|
||||
|
||||
function hasConnectionOsError(message: string): boolean {
|
||||
const osErrorCodes = new Set(["10053", "10054", "10057", "10058", "10060", "10061"]);
|
||||
const osErrorCodes = new Set(["65", "10053", "10054", "10057", "10058", "10060", "10061"]);
|
||||
const match = message.match(/os error\s+(\d+)/);
|
||||
return !!match && osErrorCodes.has(match[1]);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { QueryResult, QueryTab } from "@/types/database";
|
||||
|
||||
function isErrorResult(result: QueryResult | undefined): boolean {
|
||||
return result?.columns.length === 1 && result.columns[0] === "Error";
|
||||
}
|
||||
|
||||
export function canActivateExistingDataTableTab(tab: QueryTab): boolean {
|
||||
if (tab.isExecuting) return true;
|
||||
if (isErrorResult(tab.result)) return false;
|
||||
return !!tab.result || !!tab.results?.length;
|
||||
}
|
||||
Reference in new issue
Block a user