Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
e2a8ad5f
Commit
e2a8ad5f
authored
Apr 22, 2024
by
Jun Siang Cheah
Browse files
address comments, rename to ENABLE_ADMIN_EXPORT
parent
190b934a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
14 deletions
+11
-14
backend/apps/web/routers/chats.py
backend/apps/web/routers/chats.py
+2
-5
backend/apps/web/routers/utils.py
backend/apps/web/routers/utils.py
+1
-1
backend/config.py
backend/config.py
+1
-1
backend/main.py
backend/main.py
+2
-2
src/lib/components/admin/Settings/Database.svelte
src/lib/components/admin/Settings/Database.svelte
+4
-4
src/lib/components/chat/Settings/Chats.svelte
src/lib/components/chat/Settings/Chats.svelte
+1
-1
No files found.
backend/apps/web/routers/chats.py
View file @
e2a8ad5f
...
...
@@ -28,10 +28,7 @@ from apps.web.models.tags import (
from
constants
import
ERROR_MESSAGES
from
config
import
(
SRC_LOG_LEVELS
,
ALLOW_ADMIN_EXPORT
)
from
config
import
SRC_LOG_LEVELS
,
ENABLE_ADMIN_EXPORT
log
=
logging
.
getLogger
(
__name__
)
log
.
setLevel
(
SRC_LOG_LEVELS
[
"MODELS"
])
...
...
@@ -82,7 +79,7 @@ async def get_all_user_chats(user=Depends(get_current_user)):
@
router
.
get
(
"/all/db"
,
response_model
=
List
[
ChatResponse
])
async
def
get_all_user_chats_in_db
(
user
=
Depends
(
get_admin_user
)):
if
not
ALLOW
_ADMIN_EXPORT
:
if
not
ENABLE
_ADMIN_EXPORT
:
raise
HTTPException
(
status_code
=
status
.
HTTP_401_UNAUTHORIZED
,
detail
=
ERROR_MESSAGES
.
ACCESS_PROHIBITED
,
...
...
backend/apps/web/routers/utils.py
View file @
e2a8ad5f
...
...
@@ -91,7 +91,7 @@ async def download_chat_as_pdf(
@
router
.
get
(
"/db/download"
)
async
def
download_db
(
user
=
Depends
(
get_admin_user
)):
if
not
ALLOW
_ADMIN_EXPORT
:
if
not
ENABLE
_ADMIN_EXPORT
:
raise
HTTPException
(
status_code
=
status
.
HTTP_401_UNAUTHORIZED
,
detail
=
ERROR_MESSAGES
.
ACCESS_PROHIBITED
,
...
...
backend/config.py
View file @
e2a8ad5f
...
...
@@ -382,7 +382,7 @@ MODEL_FILTER_LIST = [model.strip() for model in MODEL_FILTER_LIST.split(";")]
WEBHOOK_URL
=
os
.
environ
.
get
(
"WEBHOOK_URL"
,
""
)
ALLOW
_ADMIN_EXPORT
=
os
.
environ
.
get
(
"
ALLOW
_ADMIN_EXPORT"
,
"True"
).
lower
()
==
"true"
ENABLE
_ADMIN_EXPORT
=
os
.
environ
.
get
(
"
ENABLE
_ADMIN_EXPORT"
,
"True"
).
lower
()
==
"true"
####################################
# WEBUI_VERSION
...
...
backend/main.py
View file @
e2a8ad5f
...
...
@@ -52,7 +52,7 @@ from config import (
GLOBAL_LOG_LEVEL
,
SRC_LOG_LEVELS
,
WEBHOOK_URL
,
ALLOW
_ADMIN_EXPORT
,
ENABLE
_ADMIN_EXPORT
,
)
from
constants
import
ERROR_MESSAGES
...
...
@@ -208,7 +208,7 @@ async def get_app_config():
"default_models"
:
webui_app
.
state
.
DEFAULT_MODELS
,
"default_prompt_suggestions"
:
webui_app
.
state
.
DEFAULT_PROMPT_SUGGESTIONS
,
"trusted_header_auth"
:
bool
(
webui_app
.
state
.
AUTH_TRUSTED_EMAIL_HEADER
),
"
allow_
admin_export
"
:
ALLOW
_ADMIN_EXPORT
,
"admin_export
_enabled"
:
ENABLE
_ADMIN_EXPORT
,
}
...
...
src/lib/components/admin/Settings/Database.svelte
View file @
e2a8ad5f
...
...
@@ -25,7 +25,7 @@
<div class=" flex w-full justify-between">
<!-- <div class=" self-center text-xs font-medium">{$i18n.t('Allow Chat Deletion')}</div> -->
{#if $config?.
allow_
admin_export ?? true}
{#if $config?.admin_export
_enabled
?? true}
<button
class=" flex rounded-md py-1.5 px-3 w-full hover:bg-gray-200 dark:hover:bg-gray-800 transition"
type="button"
...
...
src/lib/components/chat/Settings/Chats.svelte
View file @
e2a8ad5f
...
...
@@ -301,7 +301,7 @@
</button>
{/if}
{#if $user?.role === 'admin' && ($config?.
allow_
admin_export ?? true)}
{#if $user?.role === 'admin' && ($config?.admin_export
_enabled
?? true)}
<hr class=" dark:border-gray-700" />
<button
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment