This commit is contained in:
Timothy Jaeryang Baek
2026-02-22 19:16:35 -06:00
parent e7848ec712
commit 2558fe1a3b
5 changed files with 32 additions and 7 deletions
@@ -414,6 +414,22 @@
{/if}
</div>
<div class="flex flex-col w-full">
<div class="flex w-full justify-between my-1">
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Web Upload')}
</div>
<Switch bind:state={permissions.chat.web_upload} />
</div>
{#if defaultPermissions?.chat?.web_upload && !permissions.chat.web_upload}
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
<div class="flex w-full justify-between my-1">
<div class=" self-center text-xs font-medium">
@@ -56,6 +56,10 @@
fileUploadCapableModels.length === selectedModels.length &&
($user?.role === 'admin' || $user?.permissions?.chat?.file_upload);
let webUploadEnabled = true;
$: webUploadEnabled =
$user?.role === 'admin' || ($user?.permissions?.chat?.web_upload ?? true);
$: if (!fileUploadEnabled && files.length > 0) {
files = [];
}
@@ -185,19 +189,17 @@
</Tooltip>
<Tooltip
content={fileUploadCapableModels.length !== selectedModels.length
? $i18n.t('Model(s) do not support file upload')
: !fileUploadEnabled
? $i18n.t('You do not have permission to upload files.')
: ''}
content={!webUploadEnabled
? $i18n.t('You do not have permission to upload web content.')
: ''}
className="w-full"
>
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl {!fileUploadEnabled
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl {!webUploadEnabled
? 'opacity-50'
: ''}"
on:click={() => {
if (fileUploadEnabled) {
if (webUploadEnabled) {
showAttachWebpageModal = true;
}
}}