enh: folder_max_file_count

This commit is contained in:
Timothy Jaeryang Baek
2026-01-01 02:51:35 +04:00
parent 4eadf84e1f
commit a1036e544d
6 changed files with 45 additions and 1 deletions
@@ -8,7 +8,7 @@
import { toast } from 'svelte-sonner';
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import { user } from '$lib/stores';
import { user, config } from '$lib/stores';
import Textarea from '$lib/components/common/Textarea.svelte';
import Knowledge from '$lib/components/workspace/Models/Knowledge.svelte';
@@ -42,6 +42,14 @@
return;
}
// 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 }));
loading = false;
return;
}
await onSubmit({
name,
meta,