mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-07 08:27:05 +00:00
refac
This commit is contained in:
parent
1932ca649e
commit
c4a349651e
3 changed files with 16 additions and 0 deletions
|
|
@ -106,6 +106,7 @@ ADMIN_CONFIG_KEYS = {
|
|||
'SHOW_ADMIN_DETAILS': 'auth.admin.show',
|
||||
'ADMIN_EMAIL': 'auth.admin.email',
|
||||
'WEBUI_URL': 'webui.url',
|
||||
'ENABLE_LOGIN_FORM': 'ui.enable_login_form',
|
||||
'ENABLE_SIGNUP': 'ui.enable_signup',
|
||||
'ENABLE_API_KEYS': 'auth.enable_api_keys',
|
||||
'ENABLE_API_KEYS_ENDPOINT_RESTRICTIONS': 'auth.api_key.endpoint_restrictions',
|
||||
|
|
@ -1210,6 +1211,7 @@ class AdminConfig(BaseModel):
|
|||
SHOW_ADMIN_DETAILS: bool
|
||||
ADMIN_EMAIL: str | None = None
|
||||
WEBUI_URL: str
|
||||
ENABLE_LOGIN_FORM: bool = True
|
||||
ENABLE_SIGNUP: bool
|
||||
ENABLE_API_KEYS: bool
|
||||
ENABLE_API_KEYS_ENDPOINT_RESTRICTIONS: bool
|
||||
|
|
@ -1268,6 +1270,8 @@ class AdminConfig(BaseModel):
|
|||
@router.post('/admin/config')
|
||||
async def update_admin_config(request: Request, form_data: AdminConfig, user=Depends(get_admin_user)):
|
||||
updates = config_updates(form_data.model_dump(), ADMIN_CONFIG_KEYS)
|
||||
if 'ENABLE_LOGIN_FORM' not in form_data.model_fields_set:
|
||||
updates.pop('ui.enable_login_form', None)
|
||||
if 'I18N' not in form_data.model_fields_set:
|
||||
updates.pop('ui.i18n', None)
|
||||
updates['ui.default_interface_settings'] = form_data.DEFAULT_INTERFACE_SETTINGS or {}
|
||||
|
|
|
|||
|
|
@ -166,6 +166,16 @@
|
|||
</SettingsSelect>
|
||||
</AdminSettingRow>
|
||||
|
||||
<AdminSettingRow
|
||||
label={$i18n.t('Login Form')}
|
||||
description={$i18n.t(
|
||||
'Show email and password sign-in on the login page. Set up SSO or LDAP before disabling. Disabling also blocks local sign-ups; password API access is unchanged.'
|
||||
)}
|
||||
let:labelId
|
||||
>
|
||||
<Switch bind:state={adminConfig.ENABLE_LOGIN_FORM} ariaLabelledbyId={labelId} />
|
||||
</AdminSettingRow>
|
||||
|
||||
<AdminSettingRow
|
||||
label={$i18n.t('New Sign Ups')}
|
||||
description={$i18n.t('Allow new users to create accounts.')}
|
||||
|
|
|
|||
|
|
@ -1674,6 +1674,7 @@
|
|||
"Local Task Model": "",
|
||||
"Location": "",
|
||||
"Location access not allowed": "",
|
||||
"Login Form": "",
|
||||
"Longest active chat": "",
|
||||
"Longest streak": "",
|
||||
"Lost": "",
|
||||
|
|
@ -2608,6 +2609,7 @@
|
|||
"Show or switch the current model.": "",
|
||||
"Show Shortcuts": "",
|
||||
"Show suggested next questions after assistant responses.": "",
|
||||
"Show email and password sign-in on the login page. Set up SSO or LDAP before disabling. Disabling also blocks local sign-ups; password API access is unchanged.": "",
|
||||
"Show the floating quick-action toolbar in chat.": "",
|
||||
"Show the regenerate action menu for assistant responses.": "",
|
||||
"Show update toasts to admins when new versions are available.": "",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue