mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 13: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}
|
{selectedModels}
|
||||||
content={message.content}
|
content={message.content}
|
||||||
sources={message.sources}
|
sources={message.sources}
|
||||||
floatingButtons={message?.done && !readOnly}
|
floatingButtons={message?.done &&
|
||||||
|
!readOnly &&
|
||||||
|
($settings?.showFloatingActionButtons ?? true)}
|
||||||
save={!readOnly}
|
save={!readOnly}
|
||||||
preview={!readOnly}
|
preview={!readOnly}
|
||||||
done={($settings?.chatFadeStreamingText ?? true)
|
done={($settings?.chatFadeStreamingText ?? true)
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,9 @@
|
||||||
let collapseCodeBlocks = false;
|
let collapseCodeBlocks = false;
|
||||||
let expandDetails = false;
|
let expandDetails = false;
|
||||||
|
|
||||||
|
let showFloatingActionButtons = true;
|
||||||
|
let floatingActionButtons = null;
|
||||||
|
|
||||||
let imageCompression = false;
|
let imageCompression = false;
|
||||||
let imageCompressionSize = {
|
let imageCompressionSize = {
|
||||||
width: '',
|
width: '',
|
||||||
|
|
@ -106,7 +109,7 @@
|
||||||
saveSettings({ promptAutocomplete: promptAutocomplete });
|
saveSettings({ promptAutocomplete: promptAutocomplete });
|
||||||
};
|
};
|
||||||
|
|
||||||
const togglesScrollOnBranchChange = async () => {
|
const toggleScrollOnBranchChange = async () => {
|
||||||
scrollOnBranchChange = !scrollOnBranchChange;
|
scrollOnBranchChange = !scrollOnBranchChange;
|
||||||
saveSettings({ scrollOnBranchChange: scrollOnBranchChange });
|
saveSettings({ scrollOnBranchChange: scrollOnBranchChange });
|
||||||
};
|
};
|
||||||
|
|
@ -333,6 +336,11 @@
|
||||||
saveSettings({ iframeSandboxAllowForms });
|
saveSettings({ iframeSandboxAllowForms });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const toggleShowFloatingActionButtons = async () => {
|
||||||
|
showFloatingActionButtons = !showFloatingActionButtons;
|
||||||
|
saveSettings({ showFloatingActionButtons });
|
||||||
|
};
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
titleAutoGenerate = $settings?.title?.auto ?? true;
|
titleAutoGenerate = $settings?.title?.auto ?? true;
|
||||||
autoTags = $settings?.autoTags ?? true;
|
autoTags = $settings?.autoTags ?? true;
|
||||||
|
|
@ -386,6 +394,9 @@
|
||||||
hapticFeedback = $settings?.hapticFeedback ?? false;
|
hapticFeedback = $settings?.hapticFeedback ?? false;
|
||||||
ctrlEnterToSend = $settings?.ctrlEnterToSend ?? false;
|
ctrlEnterToSend = $settings?.ctrlEnterToSend ?? false;
|
||||||
|
|
||||||
|
showFloatingActionButtons = $settings?.showFloatingActionButtons ?? true;
|
||||||
|
floatingActionButtons = $settings?.floatingActionButtons ?? null;
|
||||||
|
|
||||||
imageCompression = $settings?.imageCompression ?? false;
|
imageCompression = $settings?.imageCompression ?? false;
|
||||||
imageCompressionSize = $settings?.imageCompressionSize ?? { width: '', height: '' };
|
imageCompressionSize = $settings?.imageCompressionSize ?? { width: '', height: '' };
|
||||||
imageCompressionInChannels = $settings?.imageCompressionInChannels ?? true;
|
imageCompressionInChannels = $settings?.imageCompressionInChannels ?? true;
|
||||||
|
|
@ -1201,7 +1212,7 @@
|
||||||
aria-labelledby="scroll-on-branch-change-label"
|
aria-labelledby="scroll-on-branch-change-label"
|
||||||
class="p-1 px-3 text-xs flex rounded-sm transition"
|
class="p-1 px-3 text-xs flex rounded-sm transition"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
togglesScrollOnBranchChange();
|
toggleScrollOnBranchChange();
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
|
|
@ -1214,6 +1225,29 @@
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
<div class=" py-0.5 flex w-full justify-between">
|
<div class=" py-0.5 flex w-full justify-between">
|
||||||
<div id="iframe-sandbox-allow-same-origin-label" class=" self-center text-xs">
|
<div id="iframe-sandbox-allow-same-origin-label" class=" self-center text-xs">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue