mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-29 06:32:52 +00:00
fix: Valves pickers in Chat Controls show while tools and functions are off (#32959)
With tools or functions turned off for the instance (ENABLE_TOOLS, ENABLE_FUNCTIONS), Chat Controls still offered both under Valves, and the list for the disabled one was always empty. Tools and functions are now only offered there while they are enabled, and the Valves section is hidden when both are off. Refs #32830
This commit is contained in:
parent
9faca2ac5b
commit
4324573f16
2 changed files with 13 additions and 7 deletions
|
|
@ -9,7 +9,7 @@
|
|||
import FileItem from '$lib/components/common/FileItem.svelte';
|
||||
import Collapsible from '$lib/components/common/Collapsible.svelte';
|
||||
|
||||
import { user, settings } from '$lib/stores';
|
||||
import { config, user, settings } from '$lib/stores';
|
||||
export let models = [];
|
||||
export let chatFiles = [];
|
||||
export let params: Record<string, any> = {};
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
</Collapsible>
|
||||
{/if}
|
||||
|
||||
{#if $user?.role === 'admin' || ($user?.permissions.chat?.valves ?? true)}
|
||||
{#if ($config?.features?.enable_tools || $config?.features?.enable_functions) && ($user?.role === 'admin' || ($user?.permissions.chat?.valves ?? true))}
|
||||
<Collapsible
|
||||
bind:open={showValves}
|
||||
onChange={setOpen('valves')}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
export let show = false;
|
||||
|
||||
let tab = 'tools';
|
||||
let tab = $config?.features?.enable_tools ? 'tools' : 'functions';
|
||||
let selectedId = '';
|
||||
|
||||
let loading = false;
|
||||
|
|
@ -167,10 +167,16 @@
|
|||
bind:value={tab}
|
||||
placeholder={$i18n.t('Select')}
|
||||
>
|
||||
<option value="tools" class="bg-gray-100 dark:bg-gray-800">{$i18n.t('Tools')}</option>
|
||||
<option value="functions" class="bg-gray-100 dark:bg-gray-800"
|
||||
>{$i18n.t('Functions')}</option
|
||||
>
|
||||
{#if $config?.features?.enable_tools}
|
||||
<option value="tools" class="bg-gray-100 dark:bg-gray-800"
|
||||
>{$i18n.t('Tools')}</option
|
||||
>
|
||||
{/if}
|
||||
{#if $config?.features?.enable_functions}
|
||||
<option value="functions" class="bg-gray-100 dark:bg-gray-800"
|
||||
>{$i18n.t('Functions')}</option
|
||||
>
|
||||
{/if}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue