This repository was archived by the owner on Jan 13, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +58
-5
lines changed
Expand file tree Collapse file tree 3 files changed +58
-5
lines changed Original file line number Diff line number Diff line change @@ -420,7 +420,7 @@ async def lifespan(app: FastAPI):
420420app .state .config = AppConfig ()
421421
422422app .state .WEBUI_NAME = WEBUI_NAME
423- app .state .LICENSE_DATA = None
423+ app .state .LICENSE_METADATA = None
424424
425425########################################
426426#
@@ -1218,7 +1218,7 @@ async def get_app_config(request: Request):
12181218 {
12191219 "record_count" : user_count ,
12201220 "active_entries" : app .state .USER_COUNT ,
1221- "license_data " : app .state .LICENSE_DATA ,
1221+ "license_metadata " : app .state .LICENSE_METADATA ,
12221222 }
12231223 if user .role == "admin"
12241224 else {}
Original file line number Diff line number Diff line change 11<script >
2- import { getContext } from ' svelte' ;
2+ import { getContext , onMount } from ' svelte' ;
33 const i18n = getContext (' i18n' );
44
55 import { WEBUI_BASE_URL } from ' $lib/constants' ;
1010
1111 export let show = true ;
1212 export let getStartedHandler = () => {};
13+
14+ function setLogoImage () {
15+ const logo = document .getElementById (' logo' );
16+
17+ if (logo) {
18+ const isDarkMode = document .documentElement .classList .contains (' dark' );
19+
20+ if (isDarkMode) {
21+ const darkImage = new Image ();
22+ darkImage .src = ' /static/favicon-dark.png' ;
23+
24+ darkImage .onload = () => {
25+ logo .src = ' /static/favicon-dark.png' ;
26+ logo .style .filter = ' ' ; // Ensure no inversion is applied if splash-dark.png exists
27+ };
28+
29+ darkImage .onerror = () => {
30+ logo .style .filter = ' invert(1)' ; // Invert image if splash-dark.png is missing
31+ };
32+ }
33+ }
34+ }
35+
36+ $: if (show) {
37+ setLogoImage ();
38+ }
1339 </script >
1440
1541{#if show }
1844 <div class =" flex space-x-2" >
1945 <div class =" self-center" >
2046 <img
47+ id =" logo"
2148 crossorigin =" anonymous"
2249 src =" {WEBUI_BASE_URL }/static/favicon.png"
2350 class =" w-6 rounded-full"
Original file line number Diff line number Diff line change 11<script >
22 import { toast } from ' svelte-sonner' ;
33
4- import { onMount , getContext } from ' svelte' ;
4+ import { onMount , getContext , tick } from ' svelte' ;
55 import { goto } from ' $app/navigation' ;
66 import { page } from ' $app/stores' ;
77
115115
116116 let onboarding = false ;
117117
118+ async function setLogoImage () {
119+ await tick ();
120+ const logo = document .getElementById (' logo' );
121+
122+ if (logo) {
123+ const isDarkMode = document .documentElement .classList .contains (' dark' );
124+
125+ if (isDarkMode) {
126+ const darkImage = new Image ();
127+ darkImage .src = ' /static/favicon-dark.png' ;
128+
129+ darkImage .onload = () => {
130+ logo .src = ' /static/favicon-dark.png' ;
131+ logo .style .filter = ' ' ; // Ensure no inversion is applied if favicon-dark.png exists
132+ };
133+
134+ darkImage .onerror = () => {
135+ logo .style .filter = ' invert(1)' ; // Invert image if favicon-dark.png is missing
136+ };
137+ }
138+ }
139+ }
140+
118141 onMount (async () => {
119142 if ($user !== undefined ) {
120143 await goto (' /' );
121144 }
122145 await checkOauthCallback ();
123146
124147 loaded = true ;
148+ setLogoImage ();
149+
125150 if (($config? .features .auth_trusted_header ?? false ) || $config? .features .auth === false ) {
126151 await signInHandler ();
127152 } else {
154179 < div class = " flex space-x-2" >
155180 < div class = " self-center" >
156181 < img
182+ id= " logo"
157183 crossorigin= " anonymous"
158184 src= " {WEBUI_BASE_URL}/static/splash.png"
159- class = " w-6 rounded-full dark:invert "
185+ class = " w-6 rounded-full"
160186 alt= " logo"
161187 / >
162188 < / div>
You can’t perform that action at this time.
0 commit comments