31 lines
750 B
JavaScript
31 lines
750 B
JavaScript
const Factory = require('./factory.js')
|
|
const { app, BrowserWindow, ipcMain, ipcRenderer } = require('electron')
|
|
const path = require('node:path')
|
|
|
|
const createWindow = () => {
|
|
const win = new BrowserWindow({
|
|
width: 800,
|
|
height: 600,
|
|
webPreferences: {
|
|
preload: path.join(__dirname, 'preload.js')
|
|
}
|
|
})
|
|
win.loadFile('index.html')
|
|
}
|
|
|
|
app.whenReady().then(() => {
|
|
ipcMain.handle('run', (_, param) => {
|
|
Factory.get(param.workflow)
|
|
Factory.workflow.run(param.application, param, './tmp/')
|
|
})
|
|
createWindow()
|
|
app.on('window-all-closed', () => {
|
|
if (process.platform !== 'darwin') app.quit()
|
|
})
|
|
})
|
|
|
|
app.on('window-all-closed', () => {
|
|
if (process.platform !== 'darwin') {
|
|
app.quit()
|
|
}
|
|
}) |