mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 12:55:19 +00:00
enh: ability to switch off floating action buttons
This commit is contained in:
parent
e16251c473
commit
93a91a678a
2 changed files with 39 additions and 3 deletions
|
|
@ -802,7 +802,9 @@
|
|||
{selectedModels}
|
||||
content={message.content}
|
||||
sources={message.sources}
|
||||
floatingButtons={message?.done && !readOnly}
|
||||
floatingButtons={message?.done &&
|
||||
!readOnly &&
|
||||
($settings?.showFloatingActionButtons ?? true)}
|
||||
save={!readOnly}
|
||||
preview={!readOnly}
|
||||
done={($settings?.chatFadeStreamingText ?? true)
|
||||
|
|
|
|||
|
|
@ -58,6 +58,9 @@
|
|||
let collapseCodeBlocks = false;
|
||||
let expandDetails = false;
|
||||
|
||||
let showFloatingActionButtons = true;
|
||||
let floatingActionButtons = null;
|
||||
|
||||
let imageCompression = false;
|
||||
let imageCompressionSize = {
|
||||
width: '',
|
||||
|
|
@ -106,7 +109,7 @@
|
|||
saveSettings({ promptAutocomplete: promptAutocomplete });
|
||||
};
|
||||
|
||||
const togglesScrollOnBranchChange = async () => {
|
||||
const toggleScrollOnBranchChange = async () => {
|
||||
scrollOnBranchChange = !scrollOnBranchChange;
|
||||
saveSettings({ scrollOnBranchChange: scrollOnBranchChange });
|
||||
};
|
||||
|
|
@ -333,6 +336,11 @@
|
|||
saveSettings({ iframeSandboxAllowForms });
|
||||
};
|
||||
|
||||
const toggleShowFloatingActionButtons = async () => {
|
||||
showFloatingActionButtons = !showFloatingActionButtons;
|
||||
saveSettings({ showFloatingActionButtons });
|
||||
};
|
||||
|
||||
onMount(async () => {
|
||||
titleAutoGenerate = $settings?.title?.auto ?? true;
|
||||
autoTags = $settings?.autoTags ?? true;
|
||||
|
|
@ -386,6 +394,9 @@
|
|||
hapticFeedback = $settings?.hapticFeedback ?? false;
|
||||
ctrlEnterToSend = $settings?.ctrlEnterToSend ?? false;
|
||||
|
||||
showFloatingActionButtons = $settings?.showFloatingActionButtons ?? true;
|
||||
floatingActionButtons = $settings?.floatingActionButtons ?? null;
|
||||
|
||||
imageCompression = $settings?.imageCompression ?? false;
|
||||
imageCompressionSize = $settings?.imageCompressionSize ?? { width: '', height: '' };
|
||||
imageCompressionInChannels = $settings?.imageCompressionInChannels ?? true;
|
||||
|
|
@ -1201,7 +1212,7 @@
|
|||
aria-labelledby="scroll-on-branch-change-label"
|
||||
class="p-1 px-3 text-xs flex rounded-sm transition"
|
||||
on:click={() => {
|
||||
togglesScrollOnBranchChange();
|
||||
toggleScrollOnBranchChange();
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
|
|
@ -1214,6 +1225,29 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class=" py-0.5 flex w-full justify-between">
|
||||
<div id="floating-action-buttons-label" class=" self-center text-xs">
|
||||
{$i18n.t('Show Floating Action Buttons')}
|
||||
</div>
|
||||
|
||||
<button
|
||||
aria-labelledby="floating-action-buttons-label"
|
||||
class="p-1 px-3 text-xs flex rounded-sm transition"
|
||||
on:click={() => {
|
||||
toggleShowFloatingActionButtons();
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
{#if showFloatingActionButtons === true}
|
||||
<span class="ml-2 self-center">{$i18n.t('On')}</span>
|
||||
{:else}
|
||||
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class=" py-0.5 flex w-full justify-between">
|
||||
<div id="iframe-sandbox-allow-same-origin-label" class=" self-center text-xs">
|
||||
|
|
|
|||
Loading…
Reference in a new issue