mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 11:57:51 +01:00
refac
This commit is contained in:
@@ -470,6 +470,9 @@ from open_webui.tasks import (
|
|||||||
from open_webui.utils.redis import get_sentinels_from_env
|
from open_webui.utils.redis import get_sentinels_from_env
|
||||||
|
|
||||||
|
|
||||||
|
from open_webui.constants import ERROR_MESSAGES
|
||||||
|
|
||||||
|
|
||||||
if SAFE_MODE:
|
if SAFE_MODE:
|
||||||
print("SAFE MODE ENABLED")
|
print("SAFE MODE ENABLED")
|
||||||
Functions.deactivate_all_functions()
|
Functions.deactivate_all_functions()
|
||||||
@@ -1423,6 +1426,14 @@ async def chat_completion(
|
|||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if metadata.get("chat_id") and (user and user.role != "admin"):
|
||||||
|
chat = Chats.get_chat_by_id_and_user_id(metadata["chat_id"], user.id)
|
||||||
|
if chat is None:
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=status.HTTP_404_NOT_FOUND,
|
||||||
|
detail=ERROR_MESSAGES.DEFAULT(),
|
||||||
|
)
|
||||||
|
|
||||||
request.state.metadata = metadata
|
request.state.metadata = metadata
|
||||||
form_data["metadata"] = metadata
|
form_data["metadata"] = metadata
|
||||||
|
|
||||||
|
|||||||
10
src/app.css
10
src/app.css
@@ -627,3 +627,13 @@ input[type='number'] {
|
|||||||
padding-right: 2px;
|
padding-right: 2px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background: #fff;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark body {
|
||||||
|
background: #171717;
|
||||||
|
color: #eee;
|
||||||
|
}
|
||||||
|
|||||||
@@ -649,11 +649,6 @@
|
|||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>{$WEBUI_NAME}</title>
|
<title>{$WEBUI_NAME}</title>
|
||||||
<link crossorigin="anonymous" rel="icon" href="{WEBUI_BASE_URL}/static/favicon.png" />
|
<link crossorigin="anonymous" rel="icon" href="{WEBUI_BASE_URL}/static/favicon.png" />
|
||||||
|
|
||||||
<!-- rosepine themes have been disabled as it's not up to date with our latest version. -->
|
|
||||||
<!-- feel free to make a PR to fix if anyone wants to see it return -->
|
|
||||||
<!-- <link rel="stylesheet" type="text/css" href="/themes/rosepine.css" />
|
|
||||||
<link rel="stylesheet" type="text/css" href="/themes/rosepine-dawn.css" /> -->
|
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
{#if loaded}
|
{#if loaded}
|
||||||
|
|||||||
Reference in New Issue
Block a user