+
+
+
+
+
+
+
+ {#if view === 'list'}
+
+ {#each $connections as conn, i (conn.id)}
+
connect(conn.id)}
+ onkeydown={(e) => e.key === 'Enter' && connect(conn.id)}
+ in:fly={{ y: 4, duration: 150, delay: i * 30 }}
+ >
+
+
+
+
+ {conn.name}
+ {#if $config?.defaultConnectionId === conn.id}
+ default
+ {/if}
+
+
{conn.url}
+
+
+
+ {#if $config?.defaultConnectionId !== conn.id}
+
+ {/if}
+
+
+
+ {:else}
+
+ No connections
+
+ {/each}
+
+
+
+
+
+ {:else if view === 'add'}
+
+
+
+
Add connection.
+
+
+
+ {/if}
+
+
+{/if}
diff --git a/src/renderer/src/lib/components/Initializing.svelte b/src/renderer/src/lib/components/Initializing.svelte
new file mode 100644
index 0000000..5e585d0
--- /dev/null
+++ b/src/renderer/src/lib/components/Initializing.svelte
@@ -0,0 +1,55 @@
+
+
+{#if visible}
+
+
+
+ {#if phase === 'ready'}
+
Open WebUI
+
Install locally.
+
+ Download and run Open WebUI on this machine.
+
+
+
+
+ {:else if phase === 'working'}
+
+

+
+
Installing…
+ {#if $serverInfo?.status}
+
+ {$serverInfo.status}
+
+ {:else}
+
+ This might take a few minutes
+
+ {/if}
+
+
+
+ {:else if phase === 'done'}
+
+

+
Ready
+
+
+ {:else if phase === 'error'}
+
+
{errorMsg}
+
+
+ {/if}
+
diff --git a/src/renderer/src/lib/components/Main.svelte b/src/renderer/src/lib/components/Main.svelte
new file mode 100644
index 0000000..7ad83fe
--- /dev/null
+++ b/src/renderer/src/lib/components/Main.svelte
@@ -0,0 +1,130 @@
+
+
+{#if visible}
+
+
+
+
+
+
+ (settingsOpen = true)}
+ />
+
+
+ {#if settingsOpen}
+
(settingsOpen = false)}
+ role="button"
+ tabindex="-1"
+ >
+
+
e.stopPropagation()}
+ >
+ (settingsOpen = false)} />
+
+
+ {/if}
+
+{/if}
diff --git a/src/renderer/src/lib/components/Main/Connections.svelte b/src/renderer/src/lib/components/Main/Connections.svelte
new file mode 100644
index 0000000..23fbc25
--- /dev/null
+++ b/src/renderer/src/lib/components/Main/Connections.svelte
@@ -0,0 +1,559 @@
+
+
+
+
+
+
+ {#if sidebarOpen}
+
+
+
+
Connections
+
+
+
+
+
+ {#each $connections as conn (conn.id)}
+
connect(conn.id)}
+ onkeydown={(e) => e.key === 'Enter' && connect(conn.id)}
+ >
+
+ {#if conn.type === 'local'}
+ {#if serverStatus === 'starting'}
+
+ {:else if serverReachable}
+
+ {:else}
+
+ {/if}
+ {:else}
+
+ {/if}
+
{conn.name}
+
+
+
+ {/each}
+
+
+
+ {#if settingsOpen}
+
(settingsOpen = false)}>
+
+
+
+
Open WebUI Desktop
+
{$appInfo?.version ?? ''}
+
+
+
+
+
+
+
+
+ {/if}
+
+
+
+
+
+
+ {/if}
+
+
+
+
diff --git a/src/renderer/src/lib/components/Main/Settings.svelte b/src/renderer/src/lib/components/Main/Settings.svelte
new file mode 100644
index 0000000..3179ba7
--- /dev/null
+++ b/src/renderer/src/lib/components/Main/Settings.svelte
@@ -0,0 +1,326 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {#if mounted}
+
+ {#if view === 'main'}
+
+
Open WebUI
+
+
+ New Connection
+
+
+
+
+
e.key === 'Enter' && connect()}
+ />
+
+
+
+
+ {#if error}
+
{error}
+ {/if}
+
+
+
+
+
+
+
+ {:else if view === 'install'}
+
+ (view = 'main')}
+ onComplete={() => appState.set('ready')}
+ />
+
+ {/if}
+
+ {/if}
+
diff --git a/src/renderer/src/lib/stores.ts b/src/renderer/src/lib/stores.ts
new file mode 100644
index 0000000..8adf1ab
--- /dev/null
+++ b/src/renderer/src/lib/stores.ts
@@ -0,0 +1,7 @@
+import { writable } from 'svelte/store'
+
+export const appInfo = writable(null)
+export const config = writable(null)
+export const connections = writable([])
+export const serverInfo = writable(null)
+export const appState = writable('loading') // loading | initializing | setup | ready
diff --git a/src/renderer/src/main.ts b/src/renderer/src/main.ts
index d176bcc..d30995e 100644
--- a/src/renderer/src/main.ts
+++ b/src/renderer/src/main.ts
@@ -1,6 +1,6 @@
import { mount } from 'svelte'
-import './assets/main.css'
+import './app.css'
import App from './App.svelte'