2024-08-21 15:40:08 -03:00
|
|
|
import { GBConfigService } from "../packages/core.gbapp/services/GBConfigService";
|
2024-08-23 00:00:04 -03:00
|
|
|
import { app, BrowserWindow } from 'electron';
|
|
|
|
import path from 'path';
|
|
|
|
import url from 'url';
|
2024-08-21 15:40:08 -03:00
|
|
|
|
2024-08-23 00:00:04 -03:00
|
|
|
export function runUI() {
|
2024-08-21 15:40:08 -03:00
|
|
|
|
|
|
|
// Create the browser window.
|
2024-08-23 00:00:04 -03:00
|
|
|
const win = new BrowserWindow({ width: 800, height: 600, title: 'General Bots Studio' });
|
2024-08-21 15:40:08 -03:00
|
|
|
|
|
|
|
// and load the index.html of the app.
|
|
|
|
win.loadURL(
|
|
|
|
url.format({
|
|
|
|
pathname: path.join(__dirname, `http://localhost:${GBConfigService.get('PORT')}`),
|
|
|
|
protocol: 'file:',
|
|
|
|
slashes: true
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2024-08-23 00:00:04 -03:00
|
|
|
app.on('ready', runUI);
|