mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-30 17:05:16 -05:00
refac
This commit is contained in:
1 parent
b52a89b8aa
commit
5659a724ff
3 files changed
+21
-10
No files matched your search
@@ -3932,7 +3932,7 @@
|
||||
let mainChatGroupId = '';
|
||||
let tabTitleEditor: import('svelte').Snippet | undefined;
|
||||
let tabActions: import('svelte').Snippet | undefined;
|
||||
let temporaryChatToggle: import('svelte').Snippet | undefined;
|
||||
let tabBarActions: import('svelte').Snippet | undefined;
|
||||
|
||||
const getChatId = async (_history: typeof history) => {
|
||||
let _chatId = $chatId;
|
||||
@@ -5410,7 +5410,7 @@
|
||||
tabbed={fullWidthTabs}
|
||||
bind:tabTitleEditor
|
||||
bind:tabActions
|
||||
bind:temporaryChatToggle
|
||||
bind:tabBarActions
|
||||
{liveParticipants}
|
||||
bind:this={navbarElement}
|
||||
readOnly={isShared}
|
||||
@@ -5792,7 +5792,7 @@
|
||||
title={$chatTitle || $i18n.t('New Chat')}
|
||||
tabTitleEditor={loading ? undefined : tabTitleEditor}
|
||||
tabActions={loading ? undefined : tabActions}
|
||||
temporaryChatToggle={loading ? undefined : temporaryChatToggle}
|
||||
tabBarActions={loading ? undefined : tabBarActions}
|
||||
bind:terminalContext
|
||||
bind:history
|
||||
bind:files
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
export let title = '';
|
||||
export let tabTitleEditor: import('svelte').Snippet | undefined = undefined;
|
||||
export let tabActions: import('svelte').Snippet | undefined = undefined;
|
||||
export let temporaryChatToggle: import('svelte').Snippet | undefined = undefined;
|
||||
export let tabBarActions: import('svelte').Snippet | undefined = undefined;
|
||||
$: fullWidth = largeScreen;
|
||||
$: panelVisible = largeScreen || !!$showTabs;
|
||||
$: if (largeScreen !== tabs.tabs.some((tab) => tab.id === mainChatTabId)) {
|
||||
@@ -1420,8 +1420,8 @@
|
||||
{/if}
|
||||
</div>
|
||||
{#if group.activeId === mainChatTabId}
|
||||
<div class="flex shrink-0 items-center">
|
||||
{@render temporaryChatToggle?.()}
|
||||
<div class="flex shrink-0 items-center gap-2">
|
||||
{@render tabBarActions?.()}
|
||||
</div>
|
||||
{/if}
|
||||
{#if !fullWidth && (!largeScreen || group.id === tabs.groups[0].id)}
|
||||
|
||||
@@ -62,10 +62,10 @@
|
||||
export let tabbed = false;
|
||||
export let tabTitleEditor: Snippet | undefined = undefined;
|
||||
export let tabActions: Snippet | undefined = undefined;
|
||||
export let temporaryChatToggle: Snippet | undefined = undefined;
|
||||
export let tabBarActions: Snippet | undefined = undefined;
|
||||
$: tabTitleEditor = confirmEdit ? renderTitleEditor : undefined;
|
||||
$: tabActions = renderChatActions;
|
||||
$: temporaryChatToggle = renderTemporaryChatToggle;
|
||||
$: tabBarActions = renderTabBarActions;
|
||||
export let onSaveTempChat: () => {};
|
||||
export let archiveChatHandler: (id: string) => void;
|
||||
export let deleteChatHandler: (id: string) => void;
|
||||
@@ -227,6 +227,15 @@
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
{#snippet renderTabBarActions()}
|
||||
{@render renderTemporaryChatToggle()}
|
||||
{#if liveParticipants.length > 0}
|
||||
<div class="flex h-6 shrink-0 items-center px-1">
|
||||
<ChatParticipants participants={liveParticipants} mode="presence" avatarClass="size-4" />
|
||||
</div>
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
{#snippet renderChatActions()}
|
||||
{#if !tabbed}{@render renderTemporaryChatToggle()}{/if}
|
||||
{#if $user?.role === 'user' ? ($user?.permissions?.chat?.temporary ?? true) && !($user?.permissions?.chat?.temporary_enforced ?? false) : true}
|
||||
@@ -262,8 +271,10 @@
|
||||
</Tooltip>
|
||||
{/if}
|
||||
|
||||
{#if liveParticipants.length > 0}
|
||||
<ChatParticipants participants={liveParticipants} mode="presence" avatarClass="size-5" />
|
||||
{#if !tabbed && liveParticipants.length > 0}
|
||||
<div class="flex h-6 shrink-0 items-center px-1">
|
||||
<ChatParticipants participants={liveParticipants} mode="presence" avatarClass="size-4" />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if shareEnabled && chat?.id && (Object.keys(history?.messages ?? {}).length > 0 || scrollToTop || ($artifactContents ?? []).length > 0 || (!readOnly && !$temporaryChatEnabled) || $user?.role === 'admin' || ($user?.permissions?.chat?.export ?? true))}
|
||||
|
||||
Reference in new issue
Block a user