mirror of
https://github.com/The-Low-Code-Foundation/OpenNoodl.git
synced 2026-03-07 17:43:28 +01:00
feat(editor): integrate local backend IPC handlers
- Add setupBackendIPC() call in app.on('ready')
- Add backendManager.stopAll() cleanup on app before-quit
- Backend IPC now available for renderer process
Test with DevTools:
await require('@electron/remote').ipcRenderer.invoke('backend:list')
await require('@electron/remote').ipcRenderer.invoke('backend:create', 'Test')
await require('@electron/remote').ipcRenderer.invoke('backend:start', backendId)
This commit is contained in:
@@ -7,6 +7,7 @@ const AutoUpdater = require('./src/autoupdater');
|
||||
const FloatingWindow = require('./src/floating-window');
|
||||
const startServer = require('./src/web-server');
|
||||
const { startCloudFunctionServer, closeRuntimeWhenWindowCloses } = require('./src/cloud-function-server');
|
||||
const { setupBackendIPC, backendManager } = require('./src/local-backend');
|
||||
const DesignToolImportServer = require('./src/design-tool-import-server');
|
||||
const jsonstorage = require('../shared/utils/jsonstorage');
|
||||
const StorageApi = require('./src/StorageApi');
|
||||
@@ -555,6 +556,9 @@ function launchApp() {
|
||||
startCloudFunctionServer(app, cloudServicesGetActive);
|
||||
closeRuntimeWhenWindowCloses(win);
|
||||
|
||||
// Initialize local backend IPC handlers
|
||||
setupBackendIPC();
|
||||
|
||||
DesignToolImportServer.start(projectGetInfo);
|
||||
|
||||
try {
|
||||
@@ -587,6 +591,15 @@ function launchApp() {
|
||||
}
|
||||
});
|
||||
|
||||
// Stop all local backends on quit
|
||||
app.on('before-quit', async () => {
|
||||
try {
|
||||
await backendManager.stopAll();
|
||||
} catch (e) {
|
||||
console.log('Error stopping backends:', e);
|
||||
}
|
||||
});
|
||||
|
||||
app.on('activate', () => {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
|
||||
Reference in New Issue
Block a user