mirror of
https://github.com/open-webui/open-webui
synced 2024-11-06 00:32:05 +00:00
refac
This commit is contained in:
parent
78dedb3389
commit
0c04b18f36
@ -361,10 +361,10 @@ async def get_app_config():
|
||||
"default_locale": default_locale,
|
||||
"default_models": webui_app.state.config.DEFAULT_MODELS,
|
||||
"default_prompt_suggestions": webui_app.state.config.DEFAULT_PROMPT_SUGGESTIONS,
|
||||
"feature_flags": {
|
||||
"features": {
|
||||
"auth": WEBUI_AUTH,
|
||||
"enable_signup": webui_app.state.config.ENABLE_SIGNUP,
|
||||
"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,
|
||||
"enable_community_sharing": webui_app.state.config.ENABLE_COMMUNITY_SHARING,
|
||||
|
@ -34,7 +34,7 @@
|
||||
<div>
|
||||
<div class=" mb-2 text-sm font-medium">{$i18n.t('Database')}</div>
|
||||
|
||||
{#if $config?.feature_flags.enable_admin_export ?? true}
|
||||
{#if $config?.features.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> -->
|
||||
|
||||
|
@ -693,7 +693,7 @@
|
||||
</button>
|
||||
</Tooltip>
|
||||
|
||||
{#if $config?.feature_flags.enable_image_generation && !readOnly}
|
||||
{#if $config?.features.enable_image_generation && !readOnly}
|
||||
<Tooltip content="Generate Image" placement="bottom">
|
||||
<button
|
||||
class="{isLastMessage
|
||||
|
@ -134,7 +134,7 @@
|
||||
<div class="flex justify-end">
|
||||
<div class="flex flex-col items-end space-x-1 mt-1.5">
|
||||
<div class="flex gap-1">
|
||||
{#if $config?.feature_flags.enable_community_sharing}
|
||||
{#if $config?.features.enable_community_sharing}
|
||||
<button
|
||||
class=" self-center px-3.5 py-2 rounded-xl text-sm font-medium bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-white"
|
||||
type="button"
|
||||
|
@ -135,7 +135,7 @@ type Config = {
|
||||
default_locale: string;
|
||||
default_models: string[];
|
||||
default_prompt_suggestions: PromptSuggestion[];
|
||||
feature_flags: {
|
||||
features: {
|
||||
auth: boolean;
|
||||
enable_signup: boolean;
|
||||
auth_trusted_header: boolean;
|
||||
|
@ -60,10 +60,7 @@
|
||||
await goto('/');
|
||||
}
|
||||
loaded = true;
|
||||
if (
|
||||
($config?.feature_flags.auth_trusted_header ?? false) ||
|
||||
$config?.feature_flags.auth === false
|
||||
) {
|
||||
if (($config?.features.auth_trusted_header ?? false) || $config?.features.auth === false) {
|
||||
await signInHandler();
|
||||
}
|
||||
});
|
||||
@ -105,7 +102,7 @@
|
||||
</div> -->
|
||||
|
||||
<div class="w-full sm:max-w-md px-10 min-h-screen flex flex-col text-center">
|
||||
{#if ($config?.feature_flags.auth_trusted_header ?? false) || $config?.feature_flags.auth === false}
|
||||
{#if ($config?.features.auth_trusted_header ?? false) || $config?.features.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"
|
||||
@ -197,7 +194,7 @@
|
||||
{mode === 'signin' ? $i18n.t('Sign in') : $i18n.t('Create Account')}
|
||||
</button>
|
||||
|
||||
{#if $config?.feature_flags.enable_signup}
|
||||
{#if $config?.features.enable_signup}
|
||||
<div class=" mt-4 text-sm text-center">
|
||||
{mode === 'signin'
|
||||
? $i18n.t("Don't have an account?")
|
||||
|
Loading…
Reference in New Issue
Block a user