mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
refac: splash screen
This commit is contained in:
@@ -484,6 +484,19 @@ if CUSTOM_NAME:
|
||||
r.raw.decode_content = True
|
||||
shutil.copyfileobj(r.raw, f)
|
||||
|
||||
if "splash" in data:
|
||||
url = (
|
||||
f"https://api.openwebui.com{data['splash']}"
|
||||
if data["splash"][0] == "/"
|
||||
else data["splash"]
|
||||
)
|
||||
|
||||
r = requests.get(url, stream=True)
|
||||
if r.status_code == 200:
|
||||
with open(f"{STATIC_DIR}/splash.png", "wb") as f:
|
||||
r.raw.decode_content = True
|
||||
shutil.copyfileobj(r.raw, f)
|
||||
|
||||
WEBUI_NAME = data["name"]
|
||||
except Exception as e:
|
||||
log.exception(e)
|
||||
|
||||
Reference in New Issue
Block a user