feat(settings): add database panel with info, backup and import

Add a Database section under Settings (split into Integrations/System
tabs) showing SQLite file size, last-modified date, a proportional
table-usage bar and per-table row counts. Supports downloading a
consistent backup and importing a .db file that overwrites the entire
database, with an explicit overwrite warning and confirmation.

Backend adds GET /api/database/info, GET /api/database/backup and
POST /api/database/import; DB_FILE is now exported from server-db.
This commit is contained in:
Brückner
2026-06-08 09:31:35 +02:00
parent f1200425af
commit e5e7c571a4
3 changed files with 377 additions and 29 deletions

View File

@ -1,7 +1,7 @@
import Database from 'better-sqlite3';
import path from 'path';
const DB_FILE = path.join(process.cwd(), 'ghostgrid.db');
export const DB_FILE = path.join(process.cwd(), 'ghostgrid.db');
console.log(`[Database] Connecting to SQLite database at: ${DB_FILE}`);
const db = new Database(DB_FILE);