feat: add Electron support for headless exe service

- Add folder selection button in UI
- Add Electron main process with IPC handlers
- Support --port and --docs command line arguments
- Support --headless mode for headless service
- Add portable exe build configuration
This commit is contained in:
2026-03-18 15:05:37 +08:00
parent 5fd9274039
commit 3d703ba7ef
80 changed files with 169500 additions and 30 deletions

9
electron/preload.mjs Normal file
View File

@@ -0,0 +1,9 @@
import { contextBridge, ipcRenderer } from 'electron';
contextBridge.exposeInMainWorld('electronAPI', {
selectFolder: () => ipcRenderer.invoke('select-folder'),
getDocsPath: () => ipcRenderer.invoke('get-docs-path'),
onDocsPathChanged: (callback: (path: string) => void) => {
ipcRenderer.on('docs-path-changed', (_event, path) => callback(path));
},
});