mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac
This commit is contained in:
parent
0dce81f646
commit
1c211e32b3
@ -30,45 +30,45 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if $user.role === 'admin' || $user?.permissions.chat?.controls}
|
<div class=" dark:text-gray-200 text-sm font-primary py-0.5 px-0.5">
|
||||||
<div class=" dark:text-gray-200 text-sm font-primary py-0.5 px-0.5">
|
{#if chatFiles.length > 0}
|
||||||
{#if chatFiles.length > 0}
|
<Collapsible title={$i18n.t('Files')} open={true} buttonClassName="w-full">
|
||||||
<Collapsible title={$i18n.t('Files')} open={true} buttonClassName="w-full">
|
<div class="flex flex-col gap-1 mt-1.5" slot="content">
|
||||||
<div class="flex flex-col gap-1 mt-1.5" slot="content">
|
{#each chatFiles as file, fileIdx}
|
||||||
{#each chatFiles as file, fileIdx}
|
<FileItem
|
||||||
<FileItem
|
className="w-full"
|
||||||
className="w-full"
|
item={file}
|
||||||
item={file}
|
edit={true}
|
||||||
edit={true}
|
url={file?.url ? file.url : null}
|
||||||
url={file?.url ? file.url : null}
|
name={file.name}
|
||||||
name={file.name}
|
type={file.type}
|
||||||
type={file.type}
|
size={file?.size}
|
||||||
size={file?.size}
|
dismissible={true}
|
||||||
dismissible={true}
|
on:dismiss={() => {
|
||||||
on:dismiss={() => {
|
// Remove the file from the chatFiles array
|
||||||
// Remove the file from the chatFiles array
|
|
||||||
|
|
||||||
chatFiles.splice(fileIdx, 1);
|
chatFiles.splice(fileIdx, 1);
|
||||||
chatFiles = chatFiles;
|
chatFiles = chatFiles;
|
||||||
}}
|
}}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
console.log(file);
|
console.log(file);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
|
||||||
</Collapsible>
|
|
||||||
|
|
||||||
<hr class="my-2 border-gray-50 dark:border-gray-700/10" />
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<Collapsible bind:open={showValves} title={$i18n.t('Valves')} buttonClassName="w-full">
|
|
||||||
<div class="text-sm" slot="content">
|
|
||||||
<Valves show={showValves} />
|
|
||||||
</div>
|
</div>
|
||||||
</Collapsible>
|
</Collapsible>
|
||||||
|
|
||||||
<hr class="my-2 border-gray-50 dark:border-gray-700/10" />
|
<hr class="my-2 border-gray-50 dark:border-gray-700/10" />
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<Collapsible bind:open={showValves} title={$i18n.t('Valves')} buttonClassName="w-full">
|
||||||
|
<div class="text-sm" slot="content">
|
||||||
|
<Valves show={showValves} />
|
||||||
|
</div>
|
||||||
|
</Collapsible>
|
||||||
|
|
||||||
|
{#if $user.role === 'admin' || $user?.permissions.chat?.controls}
|
||||||
|
<hr class="my-2 border-gray-50 dark:border-gray-700/10" />
|
||||||
|
|
||||||
<Collapsible title={$i18n.t('System Prompt')} open={true} buttonClassName="w-full">
|
<Collapsible title={$i18n.t('System Prompt')} open={true} buttonClassName="w-full">
|
||||||
<div class="" slot="content">
|
<div class="" slot="content">
|
||||||
@ -90,10 +90,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Collapsible>
|
</Collapsible>
|
||||||
</div>
|
{/if}
|
||||||
{:else}
|
</div>
|
||||||
<div class="text-sm dark:text-gray-300 text-center py-2 px-10">
|
|
||||||
{$i18n.t('You do not have permission to access this feature.')}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -350,7 +350,7 @@
|
|||||||
selectedTag = '';
|
selectedTag = '';
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{$i18n.t('Ollama')}
|
{$i18n.t('Local')}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
@ -361,7 +361,18 @@
|
|||||||
selectedTag = '';
|
selectedTag = '';
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{$i18n.t('OpenAI')}
|
{$i18n.t('External')}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="min-w-fit outline-none p-1.5 {selectedTag === ''
|
||||||
|
? ''
|
||||||
|
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition capitalize"
|
||||||
|
on:click={() => {
|
||||||
|
selectedTag = '';
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{$i18n.t('Direct')}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{#each tags as tag}
|
{#each tags as tag}
|
||||||
|
@ -130,21 +130,19 @@
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if !$mobile && ($user.role === 'admin' || $user?.permissions?.chat?.controls)}
|
<Tooltip content={$i18n.t('Controls')}>
|
||||||
<Tooltip content={$i18n.t('Controls')}>
|
<button
|
||||||
<button
|
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
||||||
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
on:click={async () => {
|
||||||
on:click={async () => {
|
await showControls.set(!$showControls);
|
||||||
await showControls.set(!$showControls);
|
}}
|
||||||
}}
|
aria-label="Controls"
|
||||||
aria-label="Controls"
|
>
|
||||||
>
|
<div class=" m-auto self-center">
|
||||||
<div class=" m-auto self-center">
|
<AdjustmentsHorizontal className=" size-5" strokeWidth="0.5" />
|
||||||
<AdjustmentsHorizontal className=" size-5" strokeWidth="0.5" />
|
</div>
|
||||||
</div>
|
</button>
|
||||||
</button>
|
</Tooltip>
|
||||||
</Tooltip>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<Tooltip content={$i18n.t('New Chat')}>
|
<Tooltip content={$i18n.t('New Chat')}>
|
||||||
<button
|
<button
|
||||||
|
Loading…
Reference in New Issue
Block a user