chore: format
This commit is contained in:
@@ -1041,7 +1041,10 @@
|
||||
selectedModels = defaultModels.filter((modelId) => availableModels.includes(modelId));
|
||||
}
|
||||
|
||||
if (selectedModels.length === 0 || (selectedModels.length === 1 && selectedModels[0] === '')) {
|
||||
if (
|
||||
selectedModels.length === 0 ||
|
||||
(selectedModels.length === 1 && selectedModels[0] === '')
|
||||
) {
|
||||
// Only fall back to first available model if default models didn't resolve
|
||||
selectedModels = [availableModels?.at(0) ?? ''];
|
||||
}
|
||||
|
||||
@@ -57,8 +57,7 @@
|
||||
($user?.role === 'admin' || $user?.permissions?.chat?.file_upload);
|
||||
|
||||
let webUploadEnabled = true;
|
||||
$: webUploadEnabled =
|
||||
$user?.role === 'admin' || ($user?.permissions?.chat?.web_upload ?? true);
|
||||
$: webUploadEnabled = $user?.role === 'admin' || ($user?.permissions?.chat?.web_upload ?? true);
|
||||
|
||||
$: if (!fileUploadEnabled && files.length > 0) {
|
||||
files = [];
|
||||
|
||||
@@ -163,7 +163,9 @@
|
||||
<div class=" py-1 -mx-0.5 w-full flex gap-1 items-center flex-wrap">
|
||||
<button
|
||||
class="text-xs font-medium text-gray-600 dark:text-gray-300 px-3.5 h-8 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 transition flex items-center gap-1 border border-gray-50 dark:border-gray-850/30"
|
||||
aria-label={citations.length === 1 ? $i18n.t('Toggle 1 source') : $i18n.t('Toggle {{COUNT}} sources', { COUNT: citations.length })}
|
||||
aria-label={citations.length === 1
|
||||
? $i18n.t('Toggle 1 source')
|
||||
: $i18n.t('Toggle {{COUNT}} sources', { COUNT: citations.length })}
|
||||
aria-expanded={showCitations}
|
||||
on:click={() => {
|
||||
showCitations = !showCitations;
|
||||
@@ -199,7 +201,9 @@
|
||||
{#each citations as citation, idx}
|
||||
<button
|
||||
id={`source-${id}-${idx + 1}`}
|
||||
aria-label={$i18n.t('View source: {{name}}', { name: decodeString(citation.source.name) })}
|
||||
aria-label={$i18n.t('View source: {{name}}', {
|
||||
name: decodeString(citation.source.name)
|
||||
})}
|
||||
class="no-toggle outline-hidden flex dark:text-gray-300 bg-transparent text-gray-600 rounded-xl gap-1.5 items-center"
|
||||
on:click={() => {
|
||||
showCitationModal = true;
|
||||
|
||||
@@ -53,14 +53,14 @@
|
||||
|
||||
<div class="ml-2 self-center flex items-center">
|
||||
<button
|
||||
aria-label={$i18n.t('Submit suggestion')}
|
||||
class="{inputValue !== ''
|
||||
? 'bg-black text-white hover:bg-gray-900 dark:bg-white dark:text-black dark:hover:bg-gray-100 '
|
||||
: 'text-white bg-gray-200 dark:text-gray-900 dark:bg-gray-700 disabled'} transition rounded-full p-1 self-center"
|
||||
on:click={() => {
|
||||
onRegenerate(inputValue);
|
||||
show = false;
|
||||
}}
|
||||
aria-label={$i18n.t('Submit suggestion')}
|
||||
class="{inputValue !== ''
|
||||
? 'bg-black text-white hover:bg-gray-900 dark:bg-white dark:text-black dark:hover:bg-gray-100 '
|
||||
: 'text-white bg-gray-200 dark:text-gray-900 dark:bg-gray-700 disabled'} transition rounded-full p-1 self-center"
|
||||
on:click={() => {
|
||||
onRegenerate(inputValue);
|
||||
show = false;
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
@@ -402,7 +402,9 @@
|
||||
class="relative w-full {($settings?.highContrastMode ?? false)
|
||||
? ''
|
||||
: 'outline-hidden focus:outline-hidden'}"
|
||||
aria-label={selectedModel ? $i18n.t('Selected model: {{modelName}}', { modelName: selectedModel.label }) : placeholder}
|
||||
aria-label={selectedModel
|
||||
? $i18n.t('Selected model: {{modelName}}', { modelName: selectedModel.label })
|
||||
: placeholder}
|
||||
id="model-selector-{id}-button"
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -56,7 +56,9 @@
|
||||
|
||||
<button
|
||||
class={data?.message?.favorite ? '' : 'invisible group-hover:visible'}
|
||||
aria-label={data?.message?.favorite ? $i18n.t('Remove from favorites') : $i18n.t('Add to favorites')}
|
||||
aria-label={data?.message?.favorite
|
||||
? $i18n.t('Remove from favorites')
|
||||
: $i18n.t('Add to favorites')}
|
||||
on:click={() => {
|
||||
data.message.favorite = !(data?.message?.favorite ?? false);
|
||||
}}
|
||||
|
||||
@@ -202,7 +202,11 @@
|
||||
exportHandler();
|
||||
}}
|
||||
>
|
||||
<button class="p-1.5 dark:hover:bg-gray-850 rounded-full touch-auto" aria-label={$i18n.t('Folder options')} on:click={(e) => {}}>
|
||||
<button
|
||||
class="p-1.5 dark:hover:bg-gray-850 rounded-full touch-auto"
|
||||
aria-label={$i18n.t('Folder options')}
|
||||
on:click={(e) => {}}
|
||||
>
|
||||
<EllipsisHorizontal className="size-4" strokeWidth="2.5" />
|
||||
</button>
|
||||
</FolderMenu>
|
||||
|
||||
@@ -1233,47 +1233,47 @@
|
||||
{'think'} ({$i18n.t('Ollama')})
|
||||
</div>
|
||||
<button
|
||||
class="p-1 px-3 text-xs flex rounded-sm transition"
|
||||
on:click={() => {
|
||||
if ((params?.think ?? null) === null) {
|
||||
params.think = true;
|
||||
} else if (params.think === true) {
|
||||
params.think = 'medium';
|
||||
} else if (typeof params.think === 'string') {
|
||||
params.think = false;
|
||||
} else {
|
||||
params.think = null;
|
||||
}
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
{#if params.think === true}
|
||||
<span class="ml-2 self-center">{$i18n.t('On')}</span>
|
||||
{:else if params.think === false}
|
||||
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
|
||||
{:else if typeof params.think === 'string'}
|
||||
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
||||
{:else}
|
||||
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
||||
{#if typeof params.think === 'string'}
|
||||
<div class="flex mt-0.5 space-x-2">
|
||||
<div class=" flex-1">
|
||||
<input
|
||||
class="text-sm w-full bg-transparent outline-hidden outline-none"
|
||||
type="text"
|
||||
placeholder={$i18n.t("e.g. 'low', 'medium', 'high'")}
|
||||
bind:value={params.think}
|
||||
autocomplete="off"
|
||||
/>
|
||||
class="p-1 px-3 text-xs flex rounded-sm transition"
|
||||
on:click={() => {
|
||||
if ((params?.think ?? null) === null) {
|
||||
params.think = true;
|
||||
} else if (params.think === true) {
|
||||
params.think = 'medium';
|
||||
} else if (typeof params.think === 'string') {
|
||||
params.think = false;
|
||||
} else {
|
||||
params.think = null;
|
||||
}
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
{#if params.think === true}
|
||||
<span class="ml-2 self-center">{$i18n.t('On')}</span>
|
||||
{:else if params.think === false}
|
||||
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
|
||||
{:else if typeof params.think === 'string'}
|
||||
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
||||
{:else}
|
||||
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
||||
{#if typeof params.think === 'string'}
|
||||
<div class="flex mt-0.5 space-x-2">
|
||||
<div class=" flex-1">
|
||||
<input
|
||||
class="text-sm w-full bg-transparent outline-hidden outline-none"
|
||||
type="text"
|
||||
placeholder={$i18n.t("e.g. 'low', 'medium', 'high'")}
|
||||
bind:value={params.think}
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class=" py-0.5 w-full justify-between">
|
||||
<Tooltip
|
||||
|
||||
Reference in New Issue
Block a user