From e211a5cc477857bd1681d24e189688c6058015b3 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sun, 12 Jul 2026 20:14:42 +0200 Subject: [PATCH] feat(frontend): hide redundant migration download on sqlite panels Back Up's .db now restores directly into a PostgreSQL panel, so the SQLite-side Download Migration row only duplicated it; the row stays on PostgreSQL panels where it is the only PG-to-SQLite path. Restore accepts .dump and .db everywhere, the backup modal texts describe the accepted formats in all locales, and the orphaned migrationDownloadDesc key is removed. --- frontend/public/openapi.json | 4 ++-- frontend/src/pages/api-docs/endpoints.ts | 4 ++-- frontend/src/pages/index/BackupModal.tsx | 16 ++++++++-------- internal/web/translation/ar-EG.json | 5 ++--- internal/web/translation/en-US.json | 5 ++--- internal/web/translation/es-ES.json | 5 ++--- internal/web/translation/fa-IR.json | 5 ++--- internal/web/translation/id-ID.json | 5 ++--- internal/web/translation/ja-JP.json | 5 ++--- internal/web/translation/pt-BR.json | 5 ++--- internal/web/translation/ru-RU.json | 5 ++--- internal/web/translation/tr-TR.json | 5 ++--- internal/web/translation/uk-UA.json | 5 ++--- internal/web/translation/vi-VN.json | 5 ++--- internal/web/translation/zh-CN.json | 5 ++--- internal/web/translation/zh-TW.json | 5 ++--- 16 files changed, 38 insertions(+), 51 deletions(-) diff --git a/frontend/public/openapi.json b/frontend/public/openapi.json index fb73ae5a9..f3c880afb 100644 --- a/frontend/public/openapi.json +++ b/frontend/public/openapi.json @@ -4100,7 +4100,7 @@ "tags": [ "Server" ], - "summary": "Stream the SQLite database file as an attachment. Use as a manual backup.", + "summary": "Stream a full database backup as an attachment: the SQLite .db file on SQLite panels, or a pg_dump custom-format archive (.dump) on PostgreSQL panels. Use as a manual backup.", "operationId": "get_panel_api_server_getDb", "responses": { "200": { @@ -4844,7 +4844,7 @@ "tags": [ "Server" ], - "summary": "Restore the panel DB from an uploaded backup (multipart form, field name \"db\"). SQLite panels accept a .db file; PostgreSQL panels accept a pg_dump archive (.dump), a SQLite database (.db), or a SQLite migration dump. The panel restarts after restore. Destructive.", + "summary": "Restore the panel DB from an uploaded backup (multipart form, field name \"db\"). SQLite panels accept a SQLite database (.db) or a SQLite migration dump (.dump); PostgreSQL panels accept a pg_dump archive (.dump), a SQLite database (.db), or a SQLite migration dump. The panel restarts after restore. Destructive.", "operationId": "post_panel_api_server_importDB", "responses": { "200": { diff --git a/frontend/src/pages/api-docs/endpoints.ts b/frontend/src/pages/api-docs/endpoints.ts index 41da9296b..0fdd4543b 100644 --- a/frontend/src/pages/api-docs/endpoints.ts +++ b/frontend/src/pages/api-docs/endpoints.ts @@ -338,7 +338,7 @@ export const sections: readonly Section[] = [ { method: 'GET', path: '/panel/api/server/getDb', - summary: 'Stream the SQLite database file as an attachment. Use as a manual backup.', + summary: 'Stream a full database backup as an attachment: the SQLite .db file on SQLite panels, or a pg_dump custom-format archive (.dump) on PostgreSQL panels. Use as a manual backup.', }, { method: 'GET', @@ -468,7 +468,7 @@ export const sections: readonly Section[] = [ { method: 'POST', path: '/panel/api/server/importDB', - summary: 'Restore the panel DB from an uploaded backup (multipart form, field name "db"). SQLite panels accept a .db file; PostgreSQL panels accept a pg_dump archive (.dump), a SQLite database (.db), or a SQLite migration dump. The panel restarts after restore. Destructive.', + summary: 'Restore the panel DB from an uploaded backup (multipart form, field name "db"). SQLite panels accept a SQLite database (.db) or a SQLite migration dump (.dump); PostgreSQL panels accept a pg_dump archive (.dump), a SQLite database (.db), or a SQLite migration dump. The panel restarts after restore. Destructive.', params: [ { name: 'db', in: 'body (multipart)', type: 'file', desc: 'Database backup or migration file to upload.' }, ], diff --git a/frontend/src/pages/index/BackupModal.tsx b/frontend/src/pages/index/BackupModal.tsx index d24c81f12..8c31fc0a4 100644 --- a/frontend/src/pages/index/BackupModal.tsx +++ b/frontend/src/pages/index/BackupModal.tsx @@ -32,7 +32,7 @@ export default function BackupModal({ open, basePath: _basePath, onClose, onBusy function importDb() { const fileInput = document.createElement('input'); fileInput.type = 'file'; - fileInput.accept = isPostgres ? '.dump,.db' : '.db'; + fileInput.accept = '.dump,.db'; fileInput.addEventListener('change', async (e) => { const dbFile = (e.target as HTMLInputElement).files?.[0]; if (!dbFile) return; @@ -86,15 +86,15 @@ export default function BackupModal({ open, basePath: _basePath, onClose, onBusy