mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
feat(server): enhance server management with process forking and implement server origin retrieval
This commit is contained in:
parent
7be4231ad4
commit
a2847664c8
2 changed files with 56 additions and 7 deletions
|
|
@ -8,6 +8,7 @@ import { setActiveSearchSpaceId } from './active-search-space';
|
|||
const isDev = !app.isPackaged;
|
||||
const HOSTED_FRONTEND_URL = process.env.HOSTED_FRONTEND_URL as string;
|
||||
const isMac = process.platform === 'darwin';
|
||||
const WINDOW_TITLE = 'SurfSense';
|
||||
|
||||
let mainWindow: BrowserWindow | null = null;
|
||||
let isQuitting = false;
|
||||
|
|
@ -24,6 +25,7 @@ export function markQuitting(): void {
|
|||
|
||||
export function createMainWindow(initialPath = '/dashboard'): BrowserWindow {
|
||||
mainWindow = new BrowserWindow({
|
||||
title: WINDOW_TITLE,
|
||||
width: 1280,
|
||||
height: 800,
|
||||
minWidth: 800,
|
||||
|
|
@ -48,6 +50,14 @@ export function createMainWindow(initialPath = '/dashboard'): BrowserWindow {
|
|||
mainWindow?.show();
|
||||
});
|
||||
|
||||
mainWindow.webContents.on('page-title-updated', (event) => {
|
||||
event.preventDefault();
|
||||
mainWindow?.setTitle(WINDOW_TITLE);
|
||||
});
|
||||
mainWindow.webContents.on('did-finish-load', () => {
|
||||
mainWindow?.setTitle(WINDOW_TITLE);
|
||||
});
|
||||
|
||||
mainWindow.loadURL(`http://localhost:${getServerPort()}${initialPath}`);
|
||||
|
||||
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue