diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index 9ed61fbb9..dac65f0cc 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -1546,7 +1546,7 @@ ENABLE_FOLDERS = PersistentConfig( FOLDER_MAX_FILE_COUNT = PersistentConfig( "FOLDER_MAX_FILE_COUNT", "folders.max_file_count", - int(os.environ.get("FOLDER_MAX_FILE_COUNT", "100")), + os.environ.get("FOLDER_MAX_FILE_COUNT", ""), ) ENABLE_CHANNELS = PersistentConfig( diff --git a/backend/open_webui/routers/auths.py b/backend/open_webui/routers/auths.py index 34cb41727..fb0c14137 100644 --- a/backend/open_webui/routers/auths.py +++ b/backend/open_webui/routers/auths.py @@ -1013,7 +1013,7 @@ class AdminConfig(BaseModel): ENABLE_COMMUNITY_SHARING: bool ENABLE_MESSAGE_RATING: bool ENABLE_FOLDERS: bool - FOLDER_MAX_FILE_COUNT: int + FOLDER_MAX_FILE_COUNT: Optional[int | str] = None ENABLE_CHANNELS: bool ENABLE_NOTES: bool ENABLE_USER_WEBHOOKS: bool @@ -1040,7 +1040,11 @@ async def update_admin_config( ) request.app.state.config.ENABLE_FOLDERS = form_data.ENABLE_FOLDERS - request.app.state.config.FOLDER_MAX_FILE_COUNT = form_data.FOLDER_MAX_FILE_COUNT + request.app.state.config.FOLDER_MAX_FILE_COUNT = ( + int(form_data.FOLDER_MAX_FILE_COUNT) + if form_data.FOLDER_MAX_FILE_COUNT + else None + ) request.app.state.config.ENABLE_CHANNELS = form_data.ENABLE_CHANNELS request.app.state.config.ENABLE_NOTES = form_data.ENABLE_NOTES diff --git a/src/lib/components/admin/Settings/General.svelte b/src/lib/components/admin/Settings/General.svelte index 554951c8d..0b56de20e 100644 --- a/src/lib/components/admin/Settings/General.svelte +++ b/src/lib/components/admin/Settings/General.svelte @@ -334,22 +334,22 @@ - {#if adminConfig.SHOW_ADMIN_DETAILS} -
-
-
{$i18n.t('Admin Contact Email')}
-
+ {#if adminConfig.SHOW_ADMIN_DETAILS} +
+
+
{$i18n.t('Admin Contact Email')}
+
-
- +
+ +
-
- {/if} + {/if}
@@ -704,14 +704,16 @@ {#if adminConfig.ENABLE_FOLDERS}
-
{$i18n.t('Folder Max File Count')}
+
+ {$i18n.t('Folder Max File Count')} +
diff --git a/src/lib/components/layout/Sidebar/Folders/FolderModal.svelte b/src/lib/components/layout/Sidebar/Folders/FolderModal.svelte index 55c0dbaef..48bbaa08a 100644 --- a/src/lib/components/layout/Sidebar/Folders/FolderModal.svelte +++ b/src/lib/components/layout/Sidebar/Folders/FolderModal.svelte @@ -45,7 +45,9 @@ // Check folder max file count limit const maxFileCount = $config?.features?.folder_max_file_count ?? null; if (maxFileCount !== null && (data?.files ?? []).length > maxFileCount) { - toast.error($i18n.t('Maximum number of files per folder is {{max}}.', { max: maxFileCount })); + toast.error( + $i18n.t('Maximum number of files per folder is {{max}}.', { max: maxFileCount ?? 0 }) + ); loading = false; return; }