workflow_launcher/main.js
2024-05-24 08:25:41 +02:00

31 lines
728 B
JavaScript

const Factory = require('./factory.js')
const { app, BrowserWindow, ipcMain } = require('electron')
const { tmpdir } = require('node:os')
const path = require('node:path')
const createWindow = () => {
const win = new BrowserWindow({
width: 1400,
height: 1200,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
win.loadFile('index.html')
}
tmp = tmpdir()
app.disableHardwareAcceleration()
app.whenReady().then(() => {
ipcMain.handle('run', (_, param) => {
Factory.get(param.workflow)
Factory.workflow.run(param.application, param, tmp)
})
createWindow()
app.on('window-all-closed', () => {
app.quit()
})
})
app.on('window-all-closed', () => {
app.quit()
})