added login page
This commit is contained in:
parent
9bf01c0a33
commit
0f37cf98b1
13 changed files with 148 additions and 203 deletions
|
|
@ -1,4 +1,9 @@
|
|||
import { app, protocol, BrowserWindow, ipcMain } from "electron";
|
||||
import {
|
||||
app,
|
||||
protocol,
|
||||
BrowserWindow,
|
||||
ipcMain
|
||||
} from "electron";
|
||||
import { createProtocol } from "vue-cli-plugin-electron-builder/lib";
|
||||
import installExtension, { VUEJS_DEVTOOLS } from "electron-devtools-installer";
|
||||
import * as path from "path";
|
||||
|
|
@ -26,21 +31,16 @@ function createWindow() {
|
|||
maximizable: false,
|
||||
|
||||
// Postition at launch
|
||||
x: 100,
|
||||
y: 100,
|
||||
x: 10,
|
||||
y: 10,
|
||||
|
||||
webPreferences: {
|
||||
devTools: false,
|
||||
|
||||
nodeIntegration:
|
||||
(process.env.ELECTRON_NODE_INTEGRATION as unknown) as boolean,
|
||||
|
||||
preload: path.join(__dirname, "preload.js")
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
if (process.env.WEBPACK_DEV_SERVER_URL) {
|
||||
// Load the url of the dev server if in development mode
|
||||
win.loadURL(process.env.WEBPACK_DEV_SERVER_URL as string);
|
||||
|
|
@ -53,6 +53,7 @@ function createWindow() {
|
|||
}
|
||||
|
||||
|
||||
// Websockets config.
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
|
||||
// Define the websocket
|
||||
|
|
@ -90,6 +91,7 @@ function createWindow() {
|
|||
win.on("closed", () => {
|
||||
win = null;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Quit when all windows are closed.
|
||||
|
|
@ -126,13 +128,17 @@ app.on("ready", async () => {
|
|||
|
||||
// Exit cleanly on request from parent process in development mode.
|
||||
if (isDevelopment) {
|
||||
|
||||
// For windows.
|
||||
if (process.platform === "win32") {
|
||||
process.on("message", data => {
|
||||
if (data === "graceful-exit") {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
}
|
||||
|
||||
else {
|
||||
process.on("SIGTERM", () => {
|
||||
app.quit();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue