mirror of
https://github.com/open-webui/desktop
synced 2025-06-26 18:15:59 +00:00
refac
This commit is contained in:
parent
30edf4d3c8
commit
1a9c2ac192
53
src/main.ts
53
src/main.ts
@ -99,34 +99,34 @@ if (!gotTheLock) {
|
||||
|
||||
...(SERVER_STATUS === 'started'
|
||||
? [
|
||||
{
|
||||
label: 'Stop Server',
|
||||
click: async () => {
|
||||
await stopAllServers();
|
||||
SERVER_STATUS = 'stopped';
|
||||
mainWindow.webContents.send('main:data', {
|
||||
type: 'server:status',
|
||||
data: SERVER_STATUS
|
||||
});
|
||||
updateTrayMenu('Open WebUI: Stopped', null); // Update tray menu with stopped status
|
||||
}
|
||||
}
|
||||
]
|
||||
: SERVER_STATUS === 'starting'
|
||||
? [
|
||||
{
|
||||
label: 'Starting Server...',
|
||||
enabled: false
|
||||
}
|
||||
]
|
||||
: [
|
||||
{
|
||||
label: 'Start Server',
|
||||
label: 'Stop Server',
|
||||
click: async () => {
|
||||
await startServerHandler();
|
||||
await stopAllServers();
|
||||
SERVER_STATUS = 'stopped';
|
||||
mainWindow.webContents.send('main:data', {
|
||||
type: 'server:status',
|
||||
data: SERVER_STATUS
|
||||
});
|
||||
updateTrayMenu('Open WebUI: Stopped', null); // Update tray menu with stopped status
|
||||
}
|
||||
}
|
||||
]),
|
||||
]
|
||||
: SERVER_STATUS === 'starting'
|
||||
? [
|
||||
{
|
||||
label: 'Starting Server...',
|
||||
enabled: false
|
||||
}
|
||||
]
|
||||
: [
|
||||
{
|
||||
label: 'Start Server',
|
||||
click: async () => {
|
||||
await startServerHandler();
|
||||
}
|
||||
}
|
||||
]),
|
||||
|
||||
{
|
||||
type: 'separator'
|
||||
@ -174,6 +174,11 @@ if (!gotTheLock) {
|
||||
type: 'server:status',
|
||||
data: SERVER_STATUS
|
||||
});
|
||||
|
||||
if (SERVER_URL.startsWith('http://0.0.0.0')) {
|
||||
SERVER_URL = SERVER_URL.replace('http://0.0.0.0', 'http://localhost');
|
||||
}
|
||||
|
||||
mainWindow.loadURL(SERVER_URL);
|
||||
|
||||
const urlObj = new URL(SERVER_URL);
|
||||
|
||||
@ -53,7 +53,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="flex flex-row w-full h-full relative dark:text-gray-100 p-1 drag-region">
|
||||
<div class="flex flex-row w-full h-full relative dark:text-gray-100 p-1">
|
||||
<div class="fixed right-0 m-10 z-50">
|
||||
<div class="flex space-x-2">
|
||||
<button
|
||||
@ -80,6 +80,10 @@
|
||||
|
||||
<div class="w-full h-full absolute top-0 left-0 backdrop-blur-sm bg-black/50"></div>
|
||||
|
||||
<div class=" absolute w-full top-0 left-0 right-0 z-10">
|
||||
<div class="h-10 drag-region"></div>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 w-full flex justify-center relative">
|
||||
{#if $installStatus === false}
|
||||
<div class="m-auto flex flex-col justify-center text-center">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user