overall v1

This commit is contained in:
andrei-mihnea-cerbu
2024-11-12 14:00:30 +02:00
parent a5e4fc030d
commit 5ea32b2a3a
34 changed files with 1131 additions and 781 deletions
+6
View File
@@ -162,6 +162,7 @@ app.whenReady().then(async () => {
workerManager.startNetworkScannerWorker(UDP_PORT, TCP_PORT, 'login', 'uc_not_found', 'reset_database', path.join(pathToJsons, 'userConfig.json'), path.join(pathToJsons, 'application.json'));
workerManager.startDirectoriesWatchersWorker(path.join(pathToJsons, 'memory.json'), path.join(pathToJsons, 'application.json'));
workerManager.startServersWorker(HOST, UDP_PORT, TCP_PORT);
workerManager.startResourceCoordinatorWorker(
path.join(pathToJsons, 'userConfig.json'),
path.join(pathToJsons, 'application.json'),
@@ -219,6 +220,11 @@ function registerIPCHandlers() {
return await windowManager.showFileInExplorer(path);
});
ipcMain.handle('close-announcement-window', async (_event: IpcMainInvokeEvent) => {
if (!windowManager) throw new Error('WindowManager is not initialized.');
return await windowManager.closeAnnouncementWindow();
});
// TcpMethods IPC Handlers
ipcMain.handle('open-socket', async (_event: IpcMainInvokeEvent) => {
if (!applicationInfo) throw new Error('TcpMethods is not initialized.');
+1
View File
@@ -35,6 +35,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
selectDirectory: (): Promise<string | undefined> => ipcRenderer.invoke('select-directory'),
selectFile: (): Promise<string | undefined> => ipcRenderer.invoke('select-file'),
showFileInExplorer: (path: string): Promise<void> => ipcRenderer.invoke('show-file-in-explorer', path),
closeAnnouncementWindow: (): Promise<void> => ipcRenderer.invoke('close-announcement-window'),
// Queue methods
addTaskToSendFileQueue: (task: FileItemTask): Promise<void> => ipcRenderer.invoke('add-task-to-send-file-queue', task),