feat: add MySQL import wizard component and backend service for database restoration

This commit is contained in:
Ümit Tunç
2026-03-30 07:23:24 +03:00
parent 47c322294c
commit b603619286
4 changed files with 35 additions and 14 deletions
+4 -4
View File
@@ -424,7 +424,7 @@ export function registerIpcHandlers(): void {
}
})
ipcMain.handle('mysql:import-wizard:check-db', async (_event, { versionId, dbName }) => {
ipcMain.handle('mysql:import-wizard:check-db', async (_event, { versionId, dbName, rootPass }) => {
const versions = await mySqlManagerService.getVersions()
const v = versions.find(v => v.id === versionId)
if (!v) return { exists: false, error: 'MySQL version not found' }
@@ -438,13 +438,13 @@ export function registerIpcHandlers(): void {
host: '127.0.0.1',
port: v.port,
rootUser: 'root',
rootPass: '' // Assuming root has no password by default in this setup
rootPass: rootPass || ''
}, dbName)
return { exists }
})
ipcMain.handle('mysql:import-wizard:start', async (event, { versionId, filePath, dbName, user, pass, overwrite }) => {
ipcMain.handle('mysql:import-wizard:start', async (event, { versionId, filePath, dbName, user, pass, rootPass, overwrite }) => {
const versions = await mySqlManagerService.getVersions()
const v = versions.find(v => v.id === versionId)
if (!v) return { success: false, message: 'MySQL version not found' }
@@ -458,7 +458,7 @@ export function registerIpcHandlers(): void {
host: '127.0.0.1',
port: v.port,
rootUser: 'root',
rootPass: ''
rootPass: rootPass || ''
}
const log = (msg: string) => event.sender.send('mysql:import:log', msg)