feat: bootstrap Electron desktop shell for Fabric frontend

This commit is contained in:
root
2026-05-12 12:58:53 +00:00
parent 395385c9aa
commit 292d8c27f2
6 changed files with 943 additions and 0 deletions

25
main.js Normal file
View File

@@ -0,0 +1,25 @@
const { app, BrowserWindow } = require('electron')
function createWindow() {
const win = new BrowserWindow({
width: 1280,
height: 840,
webPreferences: {
contextIsolation: true,
},
})
const url = process.env.FABRIC_DESKTOP_URL || 'file://' + __dirname + '/offline.html'
win.loadURL(url)
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
})