From 82bf968f2b0aaf6ab8ce0f37708e592bd3a7cdae Mon Sep 17 00:00:00 2001 From: "Crane.z" <1481445951@qq.com> Date: Mon, 17 Aug 2026 14:44:03 +0800 Subject: [PATCH] fix(chen): handle raw console results --- ui/chen/components/ConsolePanel.vue | 5 +++++ ui/chen/composables/useChenQueryConsole.ts | 2 +- ui/chen/types.ts | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/chen/components/ConsolePanel.vue b/ui/chen/components/ConsolePanel.vue index 5bd6af6ae..985494f44 100644 --- a/ui/chen/components/ConsolePanel.vue +++ b/ui/chen/components/ConsolePanel.vue @@ -109,6 +109,11 @@ function scrollToLatest() { function resultSummary(result: ChenConsoleTimelineResult) { const shown = result.data.data.length; + if (result.state.truncated) { + const limit = + typeof result.state.rowLimit === "number" && result.state.rowLimit > 0 ? result.state.rowLimit : shown; + return `${shown} shown · truncated at ${limit}`; + } const total = typeof result.state.total === "number" && result.state.total >= 0 ? result.state.total : shown; return total > shown ? `${shown} shown · ${total} total` : `${shown} ${shown === 1 ? "row" : "rows"}`; } diff --git a/ui/chen/composables/useChenQueryConsole.ts b/ui/chen/composables/useChenQueryConsole.ts index b626a732e..abf152460 100644 --- a/ui/chen/composables/useChenQueryConsole.ts +++ b/ui/chen/composables/useChenQueryConsole.ts @@ -28,7 +28,7 @@ export function useChenQueryConsole( const entry = activeConsoleEntry(tab); if (!entry) return; - if (/^execute sql\s*:/i.test(content)) return; + if (/^execute(?: raw)? sql\s*:/i.test(content)) return; if (/^cancel query\s*:/i.test(content)) { if (!entry.logs.includes("Query cancelled.")) entry.logs.push("Query cancelled."); entry.status = "cancelled"; diff --git a/ui/chen/types.ts b/ui/chen/types.ts index 405f88fa7..6d00579df 100644 --- a/ui/chen/types.ts +++ b/ui/chen/types.ts @@ -200,6 +200,8 @@ export interface ChenConsoleState { limit?: number; total?: number; paged?: boolean; + truncated?: boolean; + rowLimit?: number; pinned?: boolean; [key: string]: any; }