fix(transfer): count tables in rebuild confirm and localize hints
This commit is contained in:
1 parent
4e8a58a08c
commit
894ecdec42
12 files changed
+12
-12
No files matched your search
@@ -1048,7 +1048,7 @@ const confirmationSummary = computed(() => {
|
||||
if (!request) return "";
|
||||
const source = `${getConnectionName(request.sourceConnectionId)}.${request.sourceDatabase}.${request.sourceSchema}`;
|
||||
const target = `${getConnectionName(request.targetConnectionId)}.${request.targetDatabase}.${request.targetSchema}`;
|
||||
const count = request.objects.reduce((total, selection) => total + selection.names.length, 0);
|
||||
const count = request.tables.length + request.objects.reduce((total, selection) => total + selection.names.length, 0);
|
||||
return t("transfer.startConfirmMessage", { source, target, count });
|
||||
});
|
||||
|
||||
@@ -1056,7 +1056,8 @@ const confirmationStrategy = computed(() => (confirmationRequest.value ? transfe
|
||||
const rebuildConfirmationDetails = computed(() => {
|
||||
const rebuild = confirmationPreview.value?.rebuild;
|
||||
if (!rebuild) return "";
|
||||
return [confirmationSummary.value, t("transfer.rebuildSummary", { count: rebuild.tables.length }), ...rebuild.warnings].filter(Boolean).join("\n");
|
||||
const missingTargets = rebuild.tables.some((table) => !table.backupTable);
|
||||
return [confirmationSummary.value, t("transfer.rebuildSummary", { count: rebuild.tables.length }), missingTargets ? t("transfer.rebuildMissingTargets") : ""].filter(Boolean).join("\n");
|
||||
});
|
||||
|
||||
function requestTransferConfirmation(request: api.TransferRequest, preview: api.TransferOwnershipPreview): Promise<boolean> {
|
||||
|
||||
@@ -46,7 +46,6 @@ function preview(overrides: Partial<TransferOwnershipPreview> = {}): TransferOwn
|
||||
rebuild: {
|
||||
sql: 'ALTER TABLE "reporting"."orders" RENAME TO "orders__dbx_bak_123";\nCREATE TABLE "reporting"."orders" ("id" INTEGER);',
|
||||
tables: [{ sourceTable: "Orders", targetTable: '"reporting"."orders"', backupTable: '"reporting"."orders__dbx_bak_123"' }],
|
||||
warnings: ["Target-only metadata will be replaced"],
|
||||
},
|
||||
...overrides,
|
||||
};
|
||||
|
||||
@@ -5615,6 +5615,7 @@ export default {
|
||||
rebuildDataOnlyDisabled: "Rebuild is unavailable for data-only transfers. Select structure and data or structure only.",
|
||||
rebuildUnsupportedDisabled: "The selected target engine does not support rebuilding target tables.",
|
||||
rebuildPreviewUnavailable: "The backend did not provide a rebuild plan. The transfer has not started; refresh the preview with a backend that supports rebuild.",
|
||||
rebuildMissingTargets: "Some target tables do not exist yet and will be created without a backup.",
|
||||
previewFailed: "Could not prepare the transfer: {message}",
|
||||
start: "Start Transfer",
|
||||
startConfirmTitle: "Confirm transfer",
|
||||
|
||||
@@ -5252,6 +5252,7 @@ export default withEnglishFallback({
|
||||
rebuildDataOnlyDisabled: "La reconstrucción no está disponible para transferencias de solo datos. Seleccione estructura y datos o solo estructura.",
|
||||
rebuildUnsupportedDisabled: "El motor de destino seleccionado no permite reconstruir las tablas de destino.",
|
||||
rebuildPreviewUnavailable: "El backend no devolvió un plan de reconstrucción. La transferencia no se ha iniciado; vuelva a obtener la vista previa con un backend compatible.",
|
||||
rebuildMissingTargets: "Algunas tablas de destino aún no existen y se crearán sin copia de seguridad.",
|
||||
previewFailed: "No se pudo preparar la transferencia: {message}",
|
||||
start: "Iniciar transferencia",
|
||||
startConfirmTitle: "Confirmar transferencia",
|
||||
|
||||
@@ -5253,6 +5253,7 @@ export default withEnglishFallback({
|
||||
rebuildDataOnlyDisabled: "La ricostruzione non è disponibile per i trasferimenti di soli dati. Selezionare struttura e dati oppure solo struttura.",
|
||||
rebuildUnsupportedDisabled: "Il motore di destinazione selezionato non supporta la ricostruzione delle tabelle di destinazione.",
|
||||
rebuildPreviewUnavailable: "Il backend non ha restituito un piano di ricostruzione. Il trasferimento non è iniziato; aggiornare l’anteprima con un backend compatibile.",
|
||||
rebuildMissingTargets: "Alcune tabelle di destinazione non esistono ancora e verranno create senza backup.",
|
||||
previewFailed: "Impossibile preparare il trasferimento: {message}",
|
||||
start: "Avvia Trasferimento",
|
||||
startConfirmTitle: "Conferma trasferimento",
|
||||
|
||||
@@ -5282,6 +5282,7 @@ export default withEnglishFallback({
|
||||
rebuildDataOnlyDisabled: "データのみの転送では再構築できません。「構造とデータ」または「構造のみ」を選択してください。",
|
||||
rebuildUnsupportedDisabled: "選択したターゲットエンジンはテーブルの再構築をサポートしていません。",
|
||||
rebuildPreviewUnavailable: "バックエンドから再構築計画が返されなかったため、転送は開始されていません。再構築プレビューに対応したバックエンドで再試行してください。",
|
||||
rebuildMissingTargets: "存在しないターゲットテーブルがあります。バックアップなしで直接作成されます。",
|
||||
previewFailed: "転送を準備できませんでした:{message}",
|
||||
start: "転送開始",
|
||||
startConfirmTitle: "転送の開始確認",
|
||||
|
||||
@@ -4947,6 +4947,7 @@ export default withEnglishFallback({
|
||||
rebuildDataOnlyDisabled: "데이터만 전송할 때는 재구축할 수 없습니다. 구조 및 데이터 또는 구조만을 선택하세요.",
|
||||
rebuildUnsupportedDisabled: "선택한 대상 엔진은 대상 테이블 재구축을 지원하지 않습니다.",
|
||||
rebuildPreviewUnavailable: "백엔드가 재구축 계획을 반환하지 않아 전송을 시작하지 않았습니다. 재구축 미리 보기를 지원하는 백엔드에서 다시 시도하세요.",
|
||||
rebuildMissingTargets: "존재하지 않는 대상 테이블이 있습니다. 백업 없이 바로 생성됩니다.",
|
||||
previewFailed: "전송을 준비할 수 없습니다: {message}",
|
||||
start: "이전 시작",
|
||||
startConfirmTitle: "전송 시작 확인",
|
||||
|
||||
@@ -5255,6 +5255,7 @@ export default withEnglishFallback({
|
||||
rebuildDataOnlyDisabled: "A reconstrução não está disponível para transferências apenas de dados. Selecione estrutura e dados ou apenas estrutura.",
|
||||
rebuildUnsupportedDisabled: "O mecanismo de destino selecionado não oferece suporte à reconstrução das tabelas de destino.",
|
||||
rebuildPreviewUnavailable: "O backend não retornou um plano de reconstrução. A transferência não foi iniciada; atualize a prévia com um backend compatível.",
|
||||
rebuildMissingTargets: "Algumas tabelas de destino ainda não existem e serão criadas sem backup.",
|
||||
previewFailed: "Não foi possível preparar a transferência: {message}",
|
||||
start: "Iniciar transferência",
|
||||
startConfirmTitle: "Confirmar transferência",
|
||||
|
||||
@@ -5599,6 +5599,7 @@ export default withEnglishFallback({
|
||||
rebuildDataOnlyDisabled: "仅数据模式不支持重建,请选择“结构和数据”或“仅结构”。",
|
||||
rebuildUnsupportedDisabled: "当前目标引擎不支持重建目标表。",
|
||||
rebuildPreviewUnavailable: "后端未返回重建计划,传输尚未开始。请使用支持重建预览的后端后重新预览。",
|
||||
rebuildMissingTargets: "部分目标表尚不存在,将直接创建(无备份)。",
|
||||
previewFailed: "无法准备传输:{message}",
|
||||
start: "开始传输",
|
||||
startConfirmTitle: "确认开始传输",
|
||||
|
||||
@@ -4570,6 +4570,7 @@ export default withEnglishFallback({
|
||||
rebuildDataOnlyDisabled: "僅資料模式不支援重建,請選擇「結構和資料」或「僅結構」。",
|
||||
rebuildUnsupportedDisabled: "目前目標引擎不支援重建目標表。",
|
||||
rebuildPreviewUnavailable: "後端未傳回重建計畫,傳輸尚未開始。請使用支援重建預覽的後端後重新預覽。",
|
||||
rebuildMissingTargets: "部分目標資料表尚不存在,將直接建立(無備份)。",
|
||||
previewFailed: "無法準備傳輸:{message}",
|
||||
start: "開始傳輸",
|
||||
startConfirmTitle: "確認開始傳輸",
|
||||
|
||||
@@ -4644,7 +4644,6 @@ export interface TransferOwnershipPreview {
|
||||
rebuild?: {
|
||||
sql: string;
|
||||
tables: Array<{ sourceTable: string; targetTable: string; backupTable?: string }>;
|
||||
warnings: string[];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user