mirror of
https://github.com/open-webui/open-webui
synced 2025-05-15 11:06:15 +00:00
refac: hide signup when ENABLE_SIGNUP false
This commit is contained in:
parent
83107c8ea5
commit
7b81271b9e
@ -357,12 +357,13 @@ async def get_app_config():
|
|||||||
"name": WEBUI_NAME,
|
"name": WEBUI_NAME,
|
||||||
"version": VERSION,
|
"version": VERSION,
|
||||||
"auth": WEBUI_AUTH,
|
"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,
|
"default_locale": default_locale,
|
||||||
"images": images_app.state.config.ENABLED,
|
|
||||||
"default_models": webui_app.state.config.DEFAULT_MODELS,
|
"default_models": webui_app.state.config.DEFAULT_MODELS,
|
||||||
"default_prompt_suggestions": webui_app.state.config.DEFAULT_PROMPT_SUGGESTIONS,
|
"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.ENABLE_MODEL_FILTER = form_data.enabled
|
||||||
app.state.config.MODEL_FILTER_LIST = form_data.models
|
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 {
|
return {
|
||||||
"enabled": app.state.config.ENABLE_MODEL_FILTER,
|
"enabled": app.state.config.ENABLE_MODEL_FILTER,
|
||||||
"models": app.state.config.MODEL_FILTER_LIST,
|
"models": app.state.config.MODEL_FILTER_LIST,
|
||||||
@ -412,7 +407,6 @@ class UrlForm(BaseModel):
|
|||||||
@app.post("/api/webhook")
|
@app.post("/api/webhook")
|
||||||
async def update_webhook_url(form_data: UrlForm, user=Depends(get_admin_user)):
|
async def update_webhook_url(form_data: UrlForm, user=Depends(get_admin_user)):
|
||||||
app.state.config.WEBHOOK_URL = form_data.url
|
app.state.config.WEBHOOK_URL = form_data.url
|
||||||
|
|
||||||
webui_app.state.WEBHOOK_URL = app.state.config.WEBHOOK_URL
|
webui_app.state.WEBHOOK_URL = app.state.config.WEBHOOK_URL
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class=" mb-2 text-sm font-medium">{$i18n.t('Database')}</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=" flex w-full justify-between">
|
||||||
<!-- <div class=" self-center text-xs font-medium">{$i18n.t('Allow Chat Deletion')}</div> -->
|
<!-- <div class=" self-center text-xs font-medium">{$i18n.t('Allow Chat Deletion')}</div> -->
|
||||||
|
|
||||||
|
@ -693,7 +693,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
{#if $config.images && !readOnly}
|
{#if $config.enable_image_generation && !readOnly}
|
||||||
<Tooltip content="Generate Image" placement="bottom">
|
<Tooltip content="Generate Image" placement="bottom">
|
||||||
<button
|
<button
|
||||||
class="{isLastMessage
|
class="{isLastMessage
|
||||||
|
@ -133,7 +133,7 @@ type Config = {
|
|||||||
images?: boolean;
|
images?: boolean;
|
||||||
default_models?: string[];
|
default_models?: string[];
|
||||||
default_prompt_suggestions?: PromptSuggestion[];
|
default_prompt_suggestions?: PromptSuggestion[];
|
||||||
trusted_header_auth?: boolean;
|
auth_trusted_header?: boolean;
|
||||||
model_config?: GlobalModelConfig;
|
model_config?: GlobalModelConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
await goto('/');
|
await goto('/');
|
||||||
}
|
}
|
||||||
loaded = true;
|
loaded = true;
|
||||||
if (($config?.trusted_header_auth ?? false) || $config?.auth === false) {
|
if (($config?.auth_trusted_header ?? false) || $config?.auth === false) {
|
||||||
await signInHandler();
|
await signInHandler();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -102,7 +102,7 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div class="w-full sm:max-w-md px-10 min-h-screen flex flex-col text-center">
|
<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=" my-auto pb-10 w-full">
|
||||||
<div
|
<div
|
||||||
class="flex items-center justify-center gap-3 text-xl sm:text-2xl text-center font-bold dark:text-gray-200"
|
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')}
|
{mode === 'signin' ? $i18n.t('Sign in') : $i18n.t('Create Account')}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
{#if $config.enable_signup}
|
||||||
<div class=" mt-4 text-sm text-center">
|
<div class=" mt-4 text-sm text-center">
|
||||||
{mode === 'signin'
|
{mode === 'signin'
|
||||||
? $i18n.t("Don't have an account?")
|
? $i18n.t("Don't have an account?")
|
||||||
@ -213,6 +214,7 @@
|
|||||||
{mode === 'signin' ? $i18n.t('Sign up') : $i18n.t('Sign in')}
|
{mode === 'signin' ? $i18n.t('Sign up') : $i18n.t('Sign in')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user