This commit is contained in:
Timothy J. Baek 2024-05-26 13:02:40 -07:00
parent 78dedb3389
commit 0c04b18f36
6 changed files with 9 additions and 12 deletions

View File

@ -361,10 +361,10 @@ async def get_app_config():
"default_locale": default_locale, "default_locale": default_locale,
"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,
"feature_flags": { "features": {
"auth": WEBUI_AUTH, "auth": WEBUI_AUTH,
"enable_signup": webui_app.state.config.ENABLE_SIGNUP,
"auth_trusted_header": bool(webui_app.state.AUTH_TRUSTED_EMAIL_HEADER), "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_image_generation": images_app.state.config.ENABLED,
"enable_admin_export": ENABLE_ADMIN_EXPORT, "enable_admin_export": ENABLE_ADMIN_EXPORT,
"enable_community_sharing": webui_app.state.config.ENABLE_COMMUNITY_SHARING, "enable_community_sharing": webui_app.state.config.ENABLE_COMMUNITY_SHARING,

View File

@ -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?.feature_flags.enable_admin_export ?? true} {#if $config?.features.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> -->

View File

@ -693,7 +693,7 @@
</button> </button>
</Tooltip> </Tooltip>
{#if $config?.feature_flags.enable_image_generation && !readOnly} {#if $config?.features.enable_image_generation && !readOnly}
<Tooltip content="Generate Image" placement="bottom"> <Tooltip content="Generate Image" placement="bottom">
<button <button
class="{isLastMessage class="{isLastMessage

View File

@ -134,7 +134,7 @@
<div class="flex justify-end"> <div class="flex justify-end">
<div class="flex flex-col items-end space-x-1 mt-1.5"> <div class="flex flex-col items-end space-x-1 mt-1.5">
<div class="flex gap-1"> <div class="flex gap-1">
{#if $config?.feature_flags.enable_community_sharing} {#if $config?.features.enable_community_sharing}
<button <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" 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" type="button"

View File

@ -135,7 +135,7 @@ type Config = {
default_locale: string; default_locale: string;
default_models: string[]; default_models: string[];
default_prompt_suggestions: PromptSuggestion[]; default_prompt_suggestions: PromptSuggestion[];
feature_flags: { features: {
auth: boolean; auth: boolean;
enable_signup: boolean; enable_signup: boolean;
auth_trusted_header: boolean; auth_trusted_header: boolean;

View File

@ -60,10 +60,7 @@
await goto('/'); await goto('/');
} }
loaded = true; loaded = true;
if ( if (($config?.features.auth_trusted_header ?? false) || $config?.features.auth === false) {
($config?.feature_flags.auth_trusted_header ?? false) ||
$config?.feature_flags.auth === false
) {
await signInHandler(); await signInHandler();
} }
}); });
@ -105,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?.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=" 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"
@ -197,7 +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?.feature_flags.enable_signup} {#if $config?.features.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?")