mirror of
https://github.com/open-webui/open-webui
synced 2025-02-17 18:46:57 +00:00
refac
This commit is contained in:
parent
faca8c8b53
commit
0ced153f86
src/lib/components
@ -7,6 +7,7 @@
|
|||||||
import AdvancedParams from '../Settings/Advanced/AdvancedParams.svelte';
|
import AdvancedParams from '../Settings/Advanced/AdvancedParams.svelte';
|
||||||
import Valves from '$lib/components/common/Valves.svelte';
|
import Valves from '$lib/components/common/Valves.svelte';
|
||||||
import FileItem from '$lib/components/common/FileItem.svelte';
|
import FileItem from '$lib/components/common/FileItem.svelte';
|
||||||
|
import Collapsible from '$lib/components/common/Collapsible.svelte';
|
||||||
|
|
||||||
export let models = [];
|
export let models = [];
|
||||||
|
|
||||||
@ -28,12 +29,10 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=" dark:text-gray-200 text-sm font-primary">
|
<div class=" dark:text-gray-200 text-sm font-primary py-0.5">
|
||||||
{#if chatFiles.length > 0}
|
{#if chatFiles.length > 0}
|
||||||
<div>
|
<Collapsible title={$i18n.t('Files')} open={true}>
|
||||||
<div class="mb-1.5 font-medium">{$i18n.t('Files')}</div>
|
<div class="flex flex-col gap-1 mt-1.5" slot="content">
|
||||||
|
|
||||||
<div class="flex flex-col gap-1">
|
|
||||||
{#each chatFiles as file, fileIdx}
|
{#each chatFiles as file, fileIdx}
|
||||||
<FileItem
|
<FileItem
|
||||||
className="w-full"
|
className="w-full"
|
||||||
@ -50,7 +49,7 @@
|
|||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Collapsible>
|
||||||
|
|
||||||
<hr class="my-2 border-gray-100 dark:border-gray-800" />
|
<hr class="my-2 border-gray-100 dark:border-gray-800" />
|
||||||
{/if}
|
{/if}
|
||||||
@ -67,27 +66,25 @@
|
|||||||
<hr class="my-2 border-gray-100 dark:border-gray-800" />
|
<hr class="my-2 border-gray-100 dark:border-gray-800" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div>
|
<Collapsible title={$i18n.t('System Prompt')} open={true}>
|
||||||
<div class="mb-1.5 font-medium">{$i18n.t('System Prompt')}</div>
|
<div class=" mt-1.5" slot="content">
|
||||||
|
|
||||||
<div>
|
|
||||||
<textarea
|
<textarea
|
||||||
bind:value={params.system}
|
bind:value={params.system}
|
||||||
class="w-full rounded-lg px-4 py-3 text-sm dark:text-gray-300 dark:bg-gray-850 border border-gray-100 dark:border-gray-800 outline-none resize-none"
|
class="w-full rounded-lg px-3.5 py-2.5 text-sm dark:text-gray-300 dark:bg-gray-850 border border-gray-100 dark:border-gray-800 outline-none resize-none"
|
||||||
rows="3"
|
rows="4"
|
||||||
placeholder={$i18n.t('Enter system prompt')}
|
placeholder={$i18n.t('Enter system prompt')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Collapsible>
|
||||||
|
|
||||||
<hr class="my-2 border-gray-100 dark:border-gray-800" />
|
<hr class="my-2 border-gray-100 dark:border-gray-800" />
|
||||||
|
|
||||||
<div>
|
<Collapsible title={$i18n.t('Advanced Params')} open={true}>
|
||||||
<div class="mb-1.5 font-medium">{$i18n.t('Advanced Params')}</div>
|
<div class="text-sm mt-1.5" slot="content">
|
||||||
|
<div>
|
||||||
<div>
|
<AdvancedParams bind:params />
|
||||||
<AdvancedParams bind:params />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Collapsible>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,14 +1,49 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { slide } from 'svelte/transition';
|
import { slide } from 'svelte/transition';
|
||||||
import { quintOut } from 'svelte/easing';
|
import { quintOut } from 'svelte/easing';
|
||||||
|
|
||||||
|
import ChevronUp from '../icons/ChevronUp.svelte';
|
||||||
|
import ChevronDown from '../icons/ChevronDown.svelte';
|
||||||
|
|
||||||
export let open = false;
|
export let open = false;
|
||||||
export let className = '';
|
export let className = '';
|
||||||
|
export let title = null;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class={className}>
|
<div class={className}>
|
||||||
<button on:click={() => (open = !open)}>
|
{#if title !== null}
|
||||||
<slot />
|
<button class="w-full" on:click={() => (open = !open)}>
|
||||||
</button>
|
<div class=" w-full font-medium transition flex items-center justify-between gap-2">
|
||||||
|
<div>
|
||||||
|
{title}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{#if open}
|
||||||
|
<ChevronUp strokeWidth="3.5" className="size-3.5 " />
|
||||||
|
{:else}
|
||||||
|
<ChevronDown strokeWidth="3.5" className="size-3.5 " />
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
{:else}
|
||||||
|
<button on:click={() => (open = !open)}>
|
||||||
|
<slot />
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="flex items-center gap-2 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition"
|
||||||
|
>
|
||||||
|
<slot />
|
||||||
|
|
||||||
|
{#if open}
|
||||||
|
<ChevronUp strokeWidth="3.5" className="size-3.5 " />
|
||||||
|
{:else}
|
||||||
|
<ChevronDown strokeWidth="3.5" className="size-3.5 " />
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
|
|
||||||
{#if open}
|
{#if open}
|
||||||
<div transition:slide={{ duration: 300, easing: quintOut, axis: 'y' }}>
|
<div transition:slide={{ duration: 300, easing: quintOut, axis: 'y' }}>
|
||||||
|
Loading…
Reference in New Issue
Block a user