mirror of
https://github.com/open-webui/desktop
synced 2025-06-26 18:15:59 +00:00
refac
This commit is contained in:
parent
29b75fd9b0
commit
fa610e6327
50
src/main.ts
50
src/main.ts
@ -99,34 +99,34 @@ if (!gotTheLock) {
|
|||||||
|
|
||||||
...(SERVER_STATUS === 'started'
|
...(SERVER_STATUS === 'started'
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
label: 'Stop Server',
|
label: 'Stop Server',
|
||||||
click: async () => {
|
click: async () => {
|
||||||
await stopAllServers();
|
await stopAllServers();
|
||||||
SERVER_STATUS = 'stopped';
|
SERVER_STATUS = 'stopped';
|
||||||
mainWindow.webContents.send('main:data', {
|
mainWindow.webContents.send('main:data', {
|
||||||
type: 'server:status',
|
type: 'server:status',
|
||||||
data: SERVER_STATUS
|
data: SERVER_STATUS
|
||||||
});
|
});
|
||||||
updateTrayMenu('Open WebUI: Stopped', null); // Update tray menu with stopped status
|
updateTrayMenu('Open WebUI: Stopped', null); // Update tray menu with stopped status
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
|
]
|
||||||
: SERVER_STATUS === 'starting'
|
: SERVER_STATUS === 'starting'
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
label: 'Starting Server...',
|
label: 'Starting Server...',
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
: [
|
: [
|
||||||
{
|
{
|
||||||
label: 'Start Server',
|
label: 'Start Server',
|
||||||
click: async () => {
|
click: async () => {
|
||||||
await startServerHandler();
|
await startServerHandler();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]),
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
@ -180,6 +180,7 @@ if (!gotTheLock) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mainWindow.loadURL(SERVER_URL);
|
mainWindow.loadURL(SERVER_URL);
|
||||||
|
mainWindow
|
||||||
|
|
||||||
const urlObj = new URL(SERVER_URL);
|
const urlObj = new URL(SERVER_URL);
|
||||||
const port = urlObj.port || '8080'; // Fallback to port 8080 if not provided
|
const port = urlObj.port || '8080'; // Fallback to port 8080 if not provided
|
||||||
@ -212,6 +213,9 @@ if (!gotTheLock) {
|
|||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload: path.join(__dirname, 'preload.js')
|
preload: path.join(__dirname, 'preload.js')
|
||||||
},
|
},
|
||||||
|
...(process.platform === 'win32' ? {
|
||||||
|
frame: false
|
||||||
|
} : {}),
|
||||||
titleBarStyle: process.platform === 'win32' ? 'default' : 'hidden',
|
titleBarStyle: process.platform === 'win32' ? 'default' : 'hidden',
|
||||||
trafficLightPosition: { x: 10, y: 10 },
|
trafficLightPosition: { x: 10, y: 10 },
|
||||||
// expose window controlls in Windows/Linux
|
// expose window controlls in Windows/Linux
|
||||||
|
Loading…
Reference in New Issue
Block a user