workflow_launcher/main.js
2024-05-15 14:00:29 +02:00

34 lines
933 B
JavaScript

const Factory = require('./factory.js')
const { app, BrowserWindow, ipcMain, ipcRenderer } = 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)
})
console.log(process.platform)
createWindow()
app.on('window-all-closed', () => {
if (process.platform !== 'darwin' && process.platform !== 'ventura') app.quit()
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin' && process.platform !== 'ventura') {
app.quit()
}
})