mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-14 13:25:20 +00:00
缩进问题:src/lib/components/chat/Navbar.svelte
This commit is contained in:
parent
e066353306
commit
e03e1ed981
1 changed files with 47 additions and 47 deletions
|
|
@ -113,39 +113,39 @@
|
||||||
<!-- ai-friend 屏蔽临时聊天 -->
|
<!-- ai-friend 屏蔽临时聊天 -->
|
||||||
{#if $user?.role === 'user' ? ($user?.permissions?.chat?.temporary ?? true) && !($user?.permissions?.chat?.temporary_enforced ?? false) : true}
|
{#if $user?.role === 'user' ? ($user?.permissions?.chat?.temporary ?? true) && !($user?.permissions?.chat?.temporary_enforced ?? false) : true}
|
||||||
{#if !chat?.id}
|
{#if !chat?.id}
|
||||||
{#if false}
|
{#if false}
|
||||||
<Tooltip content={$i18n.t(`Temporary Chat`)}>
|
<Tooltip content={$i18n.t(`Temporary Chat`)}>
|
||||||
<button
|
<button
|
||||||
class="flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
class="flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
||||||
id="temporary-chat-button"
|
id="temporary-chat-button"
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
if (($settings?.temporaryChatByDefault ?? false) && $temporaryChatEnabled) {
|
if (($settings?.temporaryChatByDefault ?? false) && $temporaryChatEnabled) {
|
||||||
// for proper initNewChat handling
|
// for proper initNewChat handling
|
||||||
await temporaryChatEnabled.set(null);
|
await temporaryChatEnabled.set(null);
|
||||||
} else {
|
} else {
|
||||||
await temporaryChatEnabled.set(!$temporaryChatEnabled);
|
await temporaryChatEnabled.set(!$temporaryChatEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
await goto('/');
|
await goto('/');
|
||||||
|
|
||||||
// add 'temporary-chat=true' to the URL
|
// add 'temporary-chat=true' to the URL
|
||||||
if ($temporaryChatEnabled) {
|
if ($temporaryChatEnabled) {
|
||||||
window.history.replaceState(null, '', '?temporary-chat=true');
|
window.history.replaceState(null, '', '?temporary-chat=true');
|
||||||
} else {
|
} else {
|
||||||
window.history.replaceState(null, '', location.pathname);
|
window.history.replaceState(null, '', location.pathname);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div class=" m-auto self-center">
|
<div class=" m-auto self-center">
|
||||||
{#if $temporaryChatEnabled}
|
{#if $temporaryChatEnabled}
|
||||||
<ChatBubbleDottedChecked className=" size-4.5" strokeWidth="1.5" />
|
<ChatBubbleDottedChecked className=" size-4.5" strokeWidth="1.5" />
|
||||||
{:else}
|
{:else}
|
||||||
<ChatBubbleDotted className=" size-4.5" strokeWidth="1.5" />
|
<ChatBubbleDotted className=" size-4.5" strokeWidth="1.5" />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
{/if}
|
{/if}
|
||||||
{:else if $temporaryChatEnabled}
|
{:else if $temporaryChatEnabled}
|
||||||
<Tooltip content={$i18n.t(`Save Chat`)}>
|
<Tooltip content={$i18n.t(`Save Chat`)}>
|
||||||
<button
|
<button
|
||||||
|
|
@ -205,23 +205,23 @@
|
||||||
{/if} -->
|
{/if} -->
|
||||||
|
|
||||||
<!-- ai-friend 屏蔽对话高级设置 -->
|
<!-- ai-friend 屏蔽对话高级设置 -->
|
||||||
{#if false}
|
{#if false}
|
||||||
{#if $user?.role === 'admin' || ($user?.permissions.chat?.controls ?? true)}
|
{#if $user?.role === 'admin' || ($user?.permissions.chat?.controls ?? true)}
|
||||||
<Tooltip content={$i18n.t('Controls')}>
|
<Tooltip content={$i18n.t('Controls')}>
|
||||||
<button
|
<button
|
||||||
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
await showControls.set(!$showControls);
|
await showControls.set(!$showControls);
|
||||||
}}
|
}}
|
||||||
aria-label="Controls"
|
aria-label="Controls"
|
||||||
>
|
>
|
||||||
<div class=" m-auto self-center">
|
<div class=" m-auto self-center">
|
||||||
<Knobs className=" size-5" strokeWidth="1" />
|
<Knobs className=" size-5" strokeWidth="1" />
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
|
||||||
|
|
||||||
<!-- {#if $user !== undefined && $user !== null}
|
<!-- {#if $user !== undefined && $user !== null}
|
||||||
<UserMenu
|
<UserMenu
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue