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
0c04b18f
Commit
0c04b18f
authored
May 26, 2024
by
Timothy J. Baek
Browse files
refac
parent
78dedb33
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
12 deletions
+9
-12
backend/main.py
backend/main.py
+2
-2
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/components/chat/ShareChatModal.svelte
src/lib/components/chat/ShareChatModal.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
+3
-6
No files found.
backend/main.py
View file @
0c04b18f
...
@@ -361,10 +361,10 @@ async def get_app_config():
...
@@ -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
_flag
s"
:
{
"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
,
...
...
src/lib/components/admin/Settings/Database.svelte
View file @
0c04b18f
...
@@ -34,7 +34,7 @@
...
@@ -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
_flag
s.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> -->
...
...
src/lib/components/chat/Messages/ResponseMessage.svelte
View file @
0c04b18f
...
@@ -693,7 +693,7 @@
...
@@ -693,7 +693,7 @@
</button>
</button>
</Tooltip>
</Tooltip>
{#if $config?.feature
_flag
s.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
...
...
src/lib/components/chat/ShareChatModal.svelte
View file @
0c04b18f
...
@@ -134,7 +134,7 @@
...
@@ -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
_flag
s.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"
...
...
src/lib/stores/index.ts
View file @
0c04b18f
...
@@ -135,7 +135,7 @@ type Config = {
...
@@ -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
_flag
s
:
{
features
:
{
auth
:
boolean
;
auth
:
boolean
;
enable_signup
:
boolean
;
enable_signup
:
boolean
;
auth_trusted_header
:
boolean
;
auth_trusted_header
:
boolean
;
...
...
src/routes/auth/+page.svelte
View file @
0c04b18f
...
@@ -60,10 +60,7 @@
...
@@ -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 @@
...
@@ -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
_flag
s.auth_trusted_header ?? false) || $config?.feature
_flag
s.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 @@
...
@@ -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
_flag
s.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?")
...
...
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