mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
refac
This commit is contained in:
parent
c8c6a48b94
commit
8f41835352
2 changed files with 14 additions and 6 deletions
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
export let id = '';
|
||||
export let sources = [];
|
||||
export let readOnly = false;
|
||||
|
||||
let citations = [];
|
||||
let showPercentage = false;
|
||||
|
|
@ -26,12 +27,18 @@
|
|||
if (citations[sourceIdx]?.source?.embed_url) {
|
||||
const embedUrl = citations[sourceIdx].source.embed_url;
|
||||
if (embedUrl) {
|
||||
showControls.set(true);
|
||||
showEmbeds.set(true);
|
||||
embed.set({
|
||||
title: citations[sourceIdx]?.source?.name || 'Embedded Content',
|
||||
url: embedUrl
|
||||
});
|
||||
if (readOnly) {
|
||||
// Open in new tab if readOnly
|
||||
window.open(embedUrl, '_blank');
|
||||
return;
|
||||
} else {
|
||||
showControls.set(true);
|
||||
showEmbeds.set(true);
|
||||
embed.set({
|
||||
title: citations[sourceIdx]?.source?.name || 'Embedded Content',
|
||||
url: embedUrl
|
||||
});
|
||||
}
|
||||
} else {
|
||||
selectedCitation = citations[sourceIdx];
|
||||
showCitationModal = true;
|
||||
|
|
|
|||
|
|
@ -809,6 +809,7 @@
|
|||
bind:this={citationsElement}
|
||||
id={message?.id}
|
||||
sources={message?.sources ?? message?.citations}
|
||||
{readOnly}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue