mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 11:57:51 +01:00
refac
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
export let id = '';
|
export let id = '';
|
||||||
export let sources = [];
|
export let sources = [];
|
||||||
|
export let readOnly = false;
|
||||||
|
|
||||||
let citations = [];
|
let citations = [];
|
||||||
let showPercentage = false;
|
let showPercentage = false;
|
||||||
@@ -26,12 +27,18 @@
|
|||||||
if (citations[sourceIdx]?.source?.embed_url) {
|
if (citations[sourceIdx]?.source?.embed_url) {
|
||||||
const embedUrl = citations[sourceIdx].source.embed_url;
|
const embedUrl = citations[sourceIdx].source.embed_url;
|
||||||
if (embedUrl) {
|
if (embedUrl) {
|
||||||
showControls.set(true);
|
if (readOnly) {
|
||||||
showEmbeds.set(true);
|
// Open in new tab if readOnly
|
||||||
embed.set({
|
window.open(embedUrl, '_blank');
|
||||||
title: citations[sourceIdx]?.source?.name || 'Embedded Content',
|
return;
|
||||||
url: embedUrl
|
} else {
|
||||||
});
|
showControls.set(true);
|
||||||
|
showEmbeds.set(true);
|
||||||
|
embed.set({
|
||||||
|
title: citations[sourceIdx]?.source?.name || 'Embedded Content',
|
||||||
|
url: embedUrl
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
selectedCitation = citations[sourceIdx];
|
selectedCitation = citations[sourceIdx];
|
||||||
showCitationModal = true;
|
showCitationModal = true;
|
||||||
|
|||||||
@@ -809,6 +809,7 @@
|
|||||||
bind:this={citationsElement}
|
bind:this={citationsElement}
|
||||||
id={message?.id}
|
id={message?.id}
|
||||||
sources={message?.sources ?? message?.citations}
|
sources={message?.sources ?? message?.citations}
|
||||||
|
{readOnly}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user