mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-28 06:22:33 +00:00
fix: auto-generation settings show while the admin turned them off (#32973)
Settings > Interface offered the title, follow-up and chat tag auto-generation switches even when the admin turned those generations off, so switching them did nothing. Each switch now only shows while its generation is on. The settings for keeping and inserting follow-up prompts stay, because they still apply to follow-ups saved in existing chats. Saved choices are kept and apply again once the admin turns the generation back on. Refs #32830
This commit is contained in:
parent
1f737b8948
commit
be8f2c0a21
3 changed files with 80 additions and 65 deletions
|
|
@ -2348,6 +2348,9 @@ async def get_app_config(request: Request):
|
|||
'code_interpreter.enable',
|
||||
'image_generation.enable',
|
||||
'task.autocomplete.enable',
|
||||
'task.title.enable',
|
||||
'task.follow_up.enable',
|
||||
'task.tags.enable',
|
||||
'ui.enable_community_sharing',
|
||||
'ui.enable_message_rating',
|
||||
'ui.enable_user_webhooks',
|
||||
|
|
@ -2445,6 +2448,9 @@ async def get_app_config(request: Request):
|
|||
'enable_code_interpreter': config.get('code_interpreter.enable'),
|
||||
'enable_image_generation': config.get('image_generation.enable'),
|
||||
'enable_autocomplete_generation': config.get('task.autocomplete.enable'),
|
||||
'enable_title_generation': config.get('task.title.enable'),
|
||||
'enable_follow_up_generation': config.get('task.follow_up.enable'),
|
||||
'enable_tags_generation': config.get('task.tags.enable'),
|
||||
'enable_community_sharing': config.get('ui.enable_community_sharing'),
|
||||
'enable_message_rating': config.get('ui.enable_message_rating'),
|
||||
'enable_user_webhooks': config.get('ui.enable_user_webhooks'),
|
||||
|
|
|
|||
|
|
@ -1109,82 +1109,88 @@
|
|||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class={settingRowClass}>
|
||||
<label
|
||||
id="auto-generation-label"
|
||||
class={settingLabelClass}
|
||||
for="auto-generation-label-control"
|
||||
>
|
||||
{$i18n.t('settings.personal.interface.titleAutoGeneration.label')}
|
||||
</label>
|
||||
{#if $config?.features?.enable_title_generation}
|
||||
<div>
|
||||
<div class={settingRowClass}>
|
||||
<label
|
||||
id="auto-generation-label"
|
||||
class={settingLabelClass}
|
||||
for="auto-generation-label-control"
|
||||
>
|
||||
{$i18n.t('settings.personal.interface.titleAutoGeneration.label')}
|
||||
</label>
|
||||
|
||||
<div class={settingControlClass}>
|
||||
<Switch
|
||||
ariaLabelledbyId="auto-generation-label"
|
||||
tooltip={true}
|
||||
bind:state={titleAutoGenerate}
|
||||
inherited={isDefaultSetting('titleAutoGenerate')}
|
||||
on:change={() => {
|
||||
toggleTitleAutoGenerate();
|
||||
}}
|
||||
/>
|
||||
<div class={settingControlClass}>
|
||||
<Switch
|
||||
ariaLabelledbyId="auto-generation-label"
|
||||
tooltip={true}
|
||||
bind:state={titleAutoGenerate}
|
||||
inherited={isDefaultSetting('titleAutoGenerate')}
|
||||
on:change={() => {
|
||||
toggleTitleAutoGenerate();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<p class={settingDescriptionClass}>
|
||||
{$i18n.t('settings.personal.interface.titleAutoGeneration.description')}
|
||||
</p>
|
||||
</div>
|
||||
<p class={settingDescriptionClass}>
|
||||
{$i18n.t('settings.personal.interface.titleAutoGeneration.description')}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div>
|
||||
<div class={settingRowClass}>
|
||||
<label
|
||||
class={settingLabelClass}
|
||||
id="follow-up-auto-generation-label"
|
||||
for="follow-up-auto-generation-label-control"
|
||||
>
|
||||
{$i18n.t('settings.personal.interface.followUpAutoGeneration.label')}
|
||||
</label>
|
||||
{#if $config?.features?.enable_follow_up_generation}
|
||||
<div>
|
||||
<div class={settingRowClass}>
|
||||
<label
|
||||
class={settingLabelClass}
|
||||
id="follow-up-auto-generation-label"
|
||||
for="follow-up-auto-generation-label-control"
|
||||
>
|
||||
{$i18n.t('settings.personal.interface.followUpAutoGeneration.label')}
|
||||
</label>
|
||||
|
||||
<div class={settingControlClass}>
|
||||
<Switch
|
||||
ariaLabelledbyId="follow-up-auto-generation-label"
|
||||
tooltip={true}
|
||||
bind:state={autoFollowUps}
|
||||
inherited={isDefaultSetting('autoFollowUps')}
|
||||
on:change={() => {
|
||||
saveSettings({ autoFollowUps });
|
||||
}}
|
||||
/>
|
||||
<div class={settingControlClass}>
|
||||
<Switch
|
||||
ariaLabelledbyId="follow-up-auto-generation-label"
|
||||
tooltip={true}
|
||||
bind:state={autoFollowUps}
|
||||
inherited={isDefaultSetting('autoFollowUps')}
|
||||
on:change={() => {
|
||||
saveSettings({ autoFollowUps });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<p class={settingDescriptionClass}>
|
||||
{$i18n.t('settings.personal.interface.followUpAutoGeneration.description')}
|
||||
</p>
|
||||
</div>
|
||||
<p class={settingDescriptionClass}>
|
||||
{$i18n.t('settings.personal.interface.followUpAutoGeneration.description')}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div>
|
||||
<div class={settingRowClass}>
|
||||
<label id="chat-tags-label" class={settingLabelClass} for="chat-tags-label-control">
|
||||
{$i18n.t('settings.personal.interface.chatTagsAutoGeneration.label')}
|
||||
</label>
|
||||
{#if $config?.features?.enable_tags_generation}
|
||||
<div>
|
||||
<div class={settingRowClass}>
|
||||
<label id="chat-tags-label" class={settingLabelClass} for="chat-tags-label-control">
|
||||
{$i18n.t('settings.personal.interface.chatTagsAutoGeneration.label')}
|
||||
</label>
|
||||
|
||||
<div class={settingControlClass}>
|
||||
<Switch
|
||||
ariaLabelledbyId="chat-tags-label"
|
||||
tooltip={true}
|
||||
bind:state={autoTags}
|
||||
inherited={isDefaultSetting('autoTags')}
|
||||
on:change={() => {
|
||||
saveSettings({ autoTags });
|
||||
}}
|
||||
/>
|
||||
<div class={settingControlClass}>
|
||||
<Switch
|
||||
ariaLabelledbyId="chat-tags-label"
|
||||
tooltip={true}
|
||||
bind:state={autoTags}
|
||||
inherited={isDefaultSetting('autoTags')}
|
||||
on:change={() => {
|
||||
saveSettings({ autoTags });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<p class={settingDescriptionClass}>
|
||||
{$i18n.t('settings.personal.interface.chatTagsAutoGeneration.description')}
|
||||
</p>
|
||||
</div>
|
||||
<p class={settingDescriptionClass}>
|
||||
{$i18n.t('settings.personal.interface.chatTagsAutoGeneration.description')}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div>
|
||||
<div class={settingRowClass}>
|
||||
|
|
|
|||
|
|
@ -394,6 +394,9 @@ type Config = {
|
|||
enable_tool_servers?: boolean;
|
||||
enable_apps?: boolean;
|
||||
enable_autocomplete_generation: boolean;
|
||||
enable_title_generation: boolean;
|
||||
enable_follow_up_generation: boolean;
|
||||
enable_tags_generation: boolean;
|
||||
enable_direct_connections: boolean;
|
||||
enable_direct_integrations?: boolean;
|
||||
enable_version_update_check: boolean;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue