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
7b81271b
Commit
7b81271b
authored
May 26, 2024
by
Timothy J. Baek
Browse files
refac: hide signup when ENABLE_SIGNUP false
parent
83107c8e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
34 deletions
+30
-34
backend/main.py
backend/main.py
+4
-10
src/lib/components/admin/Settings/Database.svelte
src/lib/components/admin/Settings/Database.svelte
+1
-1
src/lib/components/chat/Messages/ResponseMessage.svelte
src/lib/components/chat/Messages/ResponseMessage.svelte
+1
-1
src/lib/stores/index.ts
src/lib/stores/index.ts
+1
-1
src/routes/auth/+page.svelte
src/routes/auth/+page.svelte
+23
-21
No files found.
backend/main.py
View file @
7b81271b
...
...
@@ -357,12 +357,13 @@ async def get_app_config():
"name"
:
WEBUI_NAME
,
"version"
:
VERSION
,
"auth"
:
WEBUI_AUTH
,
"auth_trusted_header"
:
bool
(
webui_app
.
state
.
AUTH_TRUSTED_EMAIL_HEADER
),
"enable_signup"
:
webui_app
.
state
.
config
.
ENABLE_SIGNUP
,
"enable_image_generation"
:
images_app
.
state
.
config
.
ENABLED
,
"enable_admin_export"
:
ENABLE_ADMIN_EXPORT
,
"default_locale"
:
default_locale
,
"images"
:
images_app
.
state
.
config
.
ENABLED
,
"default_models"
:
webui_app
.
state
.
config
.
DEFAULT_MODELS
,
"default_prompt_suggestions"
:
webui_app
.
state
.
config
.
DEFAULT_PROMPT_SUGGESTIONS
,
"trusted_header_auth"
:
bool
(
webui_app
.
state
.
AUTH_TRUSTED_EMAIL_HEADER
),
"admin_export_enabled"
:
ENABLE_ADMIN_EXPORT
,
}
...
...
@@ -386,12 +387,6 @@ async def update_model_filter_config(
app
.
state
.
config
.
ENABLE_MODEL_FILTER
=
form_data
.
enabled
app
.
state
.
config
.
MODEL_FILTER_LIST
=
form_data
.
models
ollama_app
.
state
.
config
.
ENABLE_MODEL_FILTER
=
app
.
state
.
config
.
ENABLE_MODEL_FILTER
ollama_app
.
state
.
config
.
MODEL_FILTER_LIST
=
app
.
state
.
config
.
MODEL_FILTER_LIST
openai_app
.
state
.
config
.
ENABLE_MODEL_FILTER
=
app
.
state
.
config
.
ENABLE_MODEL_FILTER
openai_app
.
state
.
config
.
MODEL_FILTER_LIST
=
app
.
state
.
config
.
MODEL_FILTER_LIST
return
{
"enabled"
:
app
.
state
.
config
.
ENABLE_MODEL_FILTER
,
"models"
:
app
.
state
.
config
.
MODEL_FILTER_LIST
,
...
...
@@ -412,7 +407,6 @@ class UrlForm(BaseModel):
@
app
.
post
(
"/api/webhook"
)
async
def
update_webhook_url
(
form_data
:
UrlForm
,
user
=
Depends
(
get_admin_user
)):
app
.
state
.
config
.
WEBHOOK_URL
=
form_data
.
url
webui_app
.
state
.
WEBHOOK_URL
=
app
.
state
.
config
.
WEBHOOK_URL
return
{
...
...
src/lib/components/admin/Settings/Database.svelte
View file @
7b81271b
...
...
@@ -34,7 +34,7 @@
<div>
<div class=" mb-2 text-sm font-medium">{$i18n.t('Database')}</div>
{#if $config?.admin_export
_enabled
?? true}
{#if $config?.
enable_
admin_export ?? true}
<div class=" flex w-full justify-between">
<!-- <div class=" self-center text-xs font-medium">{$i18n.t('Allow Chat Deletion')}</div> -->
...
...
src/lib/components/chat/Messages/ResponseMessage.svelte
View file @
7b81271b
...
...
@@ -693,7 +693,7 @@
</button>
</Tooltip>
{#if $config.
images
&& !readOnly}
{#if $config.
enable_image_generation
&& !readOnly}
<Tooltip content="Generate Image" placement="bottom">
<button
class="{isLastMessage
...
...
src/lib/stores/index.ts
View file @
7b81271b
...
...
@@ -133,7 +133,7 @@ type Config = {
images
?:
boolean
;
default_models
?:
string
[];
default_prompt_suggestions
?:
PromptSuggestion
[];
trusted_header
_auth
?:
boolean
;
auth_
trusted_header
?:
boolean
;
model_config
?:
GlobalModelConfig
;
};
...
...
src/routes/auth/+page.svelte
View file @
7b81271b
...
...
@@ -60,7 +60,7 @@
await goto('/');
}
loaded = true;
if (($config?.trusted_header
_auth
?? false) || $config?.auth === false) {
if (($config?.
auth_
trusted_header ?? false) || $config?.auth === false) {
await signInHandler();
}
});
...
...
@@ -102,7 +102,7 @@
</div> -->
<div class="w-full sm:max-w-md px-10 min-h-screen flex flex-col text-center">
{#if ($config?.trusted_header
_auth
?? false) || $config?.auth === false}
{#if ($config?.
auth_
trusted_header ?? false) || $config?.auth === false}
<div class=" my-auto pb-10 w-full">
<div
class="flex items-center justify-center gap-3 text-xl sm:text-2xl text-center font-bold dark:text-gray-200"
...
...
@@ -194,6 +194,7 @@
{mode === 'signin' ? $i18n.t('Sign in') : $i18n.t('Create Account')}
</button>
{#if $config.enable_signup}
<div class=" mt-4 text-sm text-center">
{mode === 'signin'
? $i18n.t("Don't have an account?")
...
...
@@ -213,6 +214,7 @@
{mode === 'signin' ? $i18n.t('Sign up') : $i18n.t('Sign in')}
</button>
</div>
{/if}
</div>
</form>
</div>
...
...
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