refac
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
import ChevronLeft from '$lib/components/icons/ChevronLeft.svelte';
|
||||
import PageEdit from '$lib/components/icons/PageEdit.svelte';
|
||||
import Chats from './InputMenu/Chats.svelte';
|
||||
import Files from './InputMenu/Files.svelte';
|
||||
import Notes from './InputMenu/Notes.svelte';
|
||||
import Knowledge from './InputMenu/Knowledge.svelte';
|
||||
import AttachWebpageModal from './AttachWebpageModal.svelte';
|
||||
@@ -204,6 +205,38 @@
|
||||
</button>
|
||||
</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.')
|
||||
: ''}
|
||||
className="w-full"
|
||||
>
|
||||
<button
|
||||
class="flex gap-2 w-full items-center px-3 py-1.5 text-sm select-none cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50 rounded-xl {!fileUploadEnabled
|
||||
? 'opacity-50'
|
||||
: ''}"
|
||||
on:click={() => {
|
||||
if (fileUploadEnabled) {
|
||||
tab = 'files';
|
||||
}
|
||||
}}
|
||||
>
|
||||
<DocumentArrowUp />
|
||||
|
||||
<div class="flex items-center w-full justify-between">
|
||||
<div class="line-clamp-1">
|
||||
{$i18n.t('Attach Files')}
|
||||
</div>
|
||||
|
||||
<div class="text-gray-500">
|
||||
<ChevronRight />
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</Tooltip>
|
||||
|
||||
{#if $config?.features?.enable_notes ?? false}
|
||||
<Tooltip
|
||||
content={fileUploadCapableModels.length !== selectedModels.length
|
||||
@@ -481,6 +514,25 @@
|
||||
|
||||
<Notes {onSelect} />
|
||||
</div>
|
||||
{:else if tab === 'files'}
|
||||
<div in:fly={{ x: 20, duration: 150 }}>
|
||||
<button
|
||||
class="flex w-full justify-between gap-2 items-center px-3 py-1.5 text-sm select-none cursor-pointer rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800/50"
|
||||
on:click={() => {
|
||||
tab = '';
|
||||
}}
|
||||
>
|
||||
<ChevronLeft />
|
||||
|
||||
<div class="flex items-center w-full justify-between">
|
||||
<div>
|
||||
{$i18n.t('Files')}
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<Files {onSelect} />
|
||||
</div>
|
||||
{:else if tab === 'chats'}
|
||||
<div in:fly={{ x: 20, duration: 150 }}>
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user