"megatron/git@developer.sourcefind.cn:OpenDAS/megatron-lm.git" did not exist on "1e01b3a29617d7338081ecc14b3685a3c8261358"
Unverified Commit 6668d795 authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #3944 from open-webui/dev

refac
parents ef8fbaae 775a3dc3
...@@ -264,6 +264,8 @@ ...@@ -264,6 +264,8 @@
messages: {}, messages: {},
currentId: null currentId: null
}; };
chatFiles = [];
params = {}; params = {};
if ($page.url.searchParams.get('models')) { if ($page.url.searchParams.get('models')) {
......
...@@ -566,6 +566,11 @@ ...@@ -566,6 +566,11 @@
const metadata = citation.metadata?.[index]; const metadata = citation.metadata?.[index];
const id = metadata?.source ?? 'N/A'; const id = metadata?.source ?? 'N/A';
let source = citation?.source; let source = citation?.source;
if (metadata?.name) {
source = { ...source, name: metadata.name };
}
// Check if ID looks like a URL // Check if ID looks like a URL
if (id.startsWith('http://') || id.startsWith('https://')) { if (id.startsWith('http://') || id.startsWith('https://')) {
source = { name: id }; source = { name: id };
......
...@@ -99,12 +99,8 @@ ...@@ -99,12 +99,8 @@
<div class={$settings?.chatBubble ?? true ? 'self-end' : ''}> <div class={$settings?.chatBubble ?? true ? 'self-end' : ''}>
{#if file.type === 'image'} {#if file.type === 'image'}
<img src={file.url} alt="input" class=" max-h-96 rounded-lg" draggable="false" /> <img src={file.url} alt="input" class=" max-h-96 rounded-lg" draggable="false" />
{:else if file.type === 'file'} {:else}
<FileItem url={`${file?.url}/content`} name={file.name} type={$i18n.t('File')} /> <FileItem url={file.url} name={file.name} type={file.type} />
{:else if file.type === 'doc'}
<FileItem url={`${file?.url}`} name={file.name} type={$i18n.t('Document')} />
{:else if file.type === 'collection'}
<FileItem name={file?.title ?? `#${file.name}`} type={$i18n.t('Collection')} />
{/if} {/if}
</div> </div>
{/each} {/each}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment