Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: sheet oversize warning (#6335)

ecmadaof779daca3120
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 71c9b45588..fe7fc38c4d 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -2029,7 +2029,8 @@
"confirm-to-duplicate-sheet": "Confirm to duplicate this sheet?"
},
"linked-issue": "Linked issue",
- "from-sheet-warning": "The sheet comes from issue {issue}. It is read-only and only part of it is displayed."
+ "from-issue-warning": "The sheet comes from issue {issue} in read-only mode. {oversize}",
+ "content-oversize-warning": "Only display part of the sheet due to oversize."
},
"engine": {
"mysql": "MySQL",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 5366652bac..69dd5149ff 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -2007,7 +2007,8 @@
"confirm-to-duplicate-sheet": "¿Confirmar para duplicar esta hoja?"
},
"linked-issue": "Incidencia vinculada",
- "from-sheet-warning": "La hoja proviene de la incidencia {issue}. Es de solo lectura y solo se muestra una parte de ella."
+ "from-issue-warning": "La hoja proviene de la incidencia {issue} en modo de solo lectura. {oversize}",
+ "content-oversize-warning": "Mostrar solo parte de la hoja debido al tamaño excesivo."
},
"engine": {
"mysql": "MySQL",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index aa7835ad4d..23834940f5 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -2026,7 +2026,8 @@
"confirm-to-duplicate-sheet": "确定要复制这条工作表?"
},
"linked-issue": "关联工单",
- "from-sheet-warning": "这个工作表来自工单 {issue}。它是只读的且只显示了部分内容。"
+ "from-issue-warning": "这个工作表来自工单 {issue},处于只读模式。{oversize}",
+ "content-oversize-warning": "因工作表较长,仅展示部分内容。"
},
"engine": {
"mysql": "MySQL",
diff --git a/frontend/src/views/sql-editor/EditorPanel/SheetForIssueTipsBar.vue b/frontend/src/views/sql-editor/EditorPanel/SheetForIssueTipsBar.vue
index 7aba7bf3c4..65a00f66b0 100644
--- a/frontend/src/views/sql-editor/EditorPanel/SheetForIssueTipsBar.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/SheetForIssueTipsBar.vue
@@ -1,14 +1,10 @@
<template>
- <div v-if="payload" class="w-full p-4 flex bg-yellow-50">
+ <div v-if="payload || isSheetOversize" class="w-full p-4 flex bg-yellow-50">
<div class="flex-shrink-0">
<heroicons-solid:information-circle class="h-5 w-5 text-yellow-400" />
</div>
- <div class="ml-3">
- <i18n-t
- tag="h3"
- keypath="sheet.from-sheet-warning"
- class="text-sm font-medium text-yellow-800"
- >
+ <div class="ml-3 text-sm font-medium text-yellow-800">
+ <i18n-t v-if="payload" tag="h3" keypath="sheet.from-issue-warning">
<template #issue>
<NTooltip :disabled="loading || !issue">
<template #trigger>
@@ -27,7 +23,13 @@
</div>
</NTooltip>
</template>
+ <template v-if="isSheetOversize" #oversize>
+ {{ $t("sheet.content-oversize-warning") }}
+ </template>
</i18n-t>
+ <div v-else-if="isSheetOversize">
+ {{ $t("sheet.content-oversize-warning") }}
+ </div>
</div>
</div>
</template>
@@ -79,4 +81,15 @@ watch(
},
{ immediate: true }
);
+
+const isSheetOversize = computed(() => {
+ if (!sheet.value) {
+ return false;
+ }
+
+ return (
+ new TextDecoder().decode(sheet.value.content).length <
+ sheet.value.contentSize
+ );
+});
</script>