added option to toggle from UI (general settings)

This commit is contained in:
expruc 2025-10-17 22:28:35 +03:00
parent d42e8d2b67
commit 4e61514102
2 changed files with 7 additions and 6 deletions

View file

@ -707,6 +707,13 @@
<Switch bind:state={adminConfig.ENABLE_USER_WEBHOOKS} />
</div>
<div class="mb-2.5 flex w-full items-center justify-between pr-2">
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Individual Knowledge File Attachments')}
</div>
<Switch bind:state={adminConfig.ENABLE_INDIVIDUAL_KNOWLEDGE_FILE_ATTACHMENTS} />
</div>
<div class="mb-2.5">
<div class=" self-center text-xs font-medium mb-2">

View file

@ -167,12 +167,6 @@
};
});
// if ($config?.features?.enable_individual_knowledge_file_attachments) {
// items = items.filter((item) => item.type === 'file');
// }
// else {
// items = items.filter((item) => item.type === 'collection');
// }
if (!($config?.features?.enable_individual_knowledge_file_attachments ?? true)) {
items = items.filter((it) => it.type !== 'file');
}