enh: folder_max_file_count
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user