workflow_launcher/main.js

31 lines
749 B
JavaScript
Raw Normal View History

2024-03-11 11:01:07 -04:00
const Factory = require('./factory.js')
const { app, BrowserWindow, ipcMain, ipcRenderer } = require('electron')
const { tmpdir } = require('node:os')
2024-03-11 11:01:07 -04:00
const path = require('node:path')
const createWindow = () => {
const win = new BrowserWindow({
width: 1400,
height: 1200,
2024-03-11 11:01:07 -04:00
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
win.loadFile('index.html')
}
tmp = tmpdir()
app.disableHardwareAcceleration()
2024-03-11 11:01:07 -04:00
app.whenReady().then(() => {
2024-03-12 02:13:02 -04:00
ipcMain.handle('run', (_, param) => {
2024-03-11 11:01:07 -04:00
Factory.get(param.workflow)
Factory.workflow.run(param.application, param, tmp)
2024-03-11 11:01:07 -04:00
})
createWindow()
app.on('window-all-closed', () => {
2024-05-15 08:01:54 -04:00
app.quit()
2024-03-11 11:01:07 -04:00
})
})
app.on('window-all-closed', () => {
2024-05-15 08:01:54 -04:00
app.quit()
2024-03-11 11:01:07 -04:00
})