mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-18 04:43:55 +00:00
fix: inline HTML preview in a reply shows "File not found" on a Per chat terminal (#32485)
With an Open Terminal orchestrator connection set to Terminal Contexts > Chat = "Per chat" (Admin > Integrations > Open Terminal), the preview of an HTML file shown inside an assistant reply looked for the file in the shared terminal workspace, so it showed "File not found" even though the file sits in the chat's own workspace. The sidebar file browser already opens the same file correctly since #32418. The preview inside the reply now uses the chat's own workspace as well. Fixes #32477
This commit is contained in:
parent
0696bfdf27
commit
ec39df7da5
1 changed files with 8 additions and 1 deletions
|
|
@ -58,6 +58,13 @@
|
|||
$: terminal = resolveTerminal();
|
||||
$: unavailable = !terminal;
|
||||
$: previewKey = terminal ? `${terminal.url}|${terminal.key}|${path}|${chatId}` : '';
|
||||
$: isPerChatTerminal =
|
||||
($terminalServers ?? []).find((server: any) => server.id === selector)?.contexts?.chat
|
||||
?.context_id === 'chat_id';
|
||||
$: previewBaseUrl =
|
||||
terminal && isPerChatTerminal && chatId
|
||||
? `${terminal.url}/chats/${encodeURIComponent(chatId)}`
|
||||
: (terminal?.url ?? '');
|
||||
$: previewClass = isImage(path)
|
||||
? 'h-[22rem]'
|
||||
: isPdf(path) ||
|
||||
|
|
@ -299,7 +306,7 @@
|
|||
{fileSqliteData}
|
||||
{fileDocxData}
|
||||
{fileContent}
|
||||
baseUrl={terminal?.url ?? ''}
|
||||
baseUrl={previewBaseUrl}
|
||||
apiKey={terminal?.key ?? ''}
|
||||
{fileOfficeHtml}
|
||||
{fileOfficeSlides}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue