diff --git a/apps/desktop/src/components/sql-file/SqlFileExecutionDialog.vue b/apps/desktop/src/components/sql-file/SqlFileExecutionDialog.vue index 1957b10f2b..25003f4152 100644 --- a/apps/desktop/src/components/sql-file/SqlFileExecutionDialog.vue +++ b/apps/desktop/src/components/sql-file/SqlFileExecutionDialog.vue @@ -97,6 +97,17 @@ const progressPercent = computed(() => { if (current <= 0) return running.value ? 8 : 0; return Math.min(95, Math.max(8, Math.round((attempted / current) * 100))); }); +const previewLineCount = computed(() => preview.value?.preview.split(/\r\n|\r|\n/).length ?? 0); +const previewLineNumbers = computed(() => Array.from({ length: previewLineCount.value }, (_, index) => index + 1)); +const previewIsTruncated = computed(() => { + if (!preview.value) return false; + return preview.value.sizeBytes > preview.value.preview.length; +}); +const previewLineSummary = computed(() => + previewIsTruncated.value + ? t("sqlFile.previewingFirstLines", { count: previewLineCount.value }) + : t("sqlFile.previewingLines", { count: previewLineCount.value }), +); function connectionIconType(id: string) { const config = store.getConfig(id); @@ -393,7 +404,7 @@ watch(