mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac
This commit is contained in:
@@ -154,6 +154,14 @@
|
||||
keys: ['name', 'description']
|
||||
});
|
||||
});
|
||||
|
||||
const decodeString = (str: string) => {
|
||||
try {
|
||||
return decodeURIComponent(str);
|
||||
} catch (e) {
|
||||
return str;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
{#if filteredItems.length > 0 || prompt.split(' ')?.at(0)?.substring(1).startsWith('http')}
|
||||
@@ -210,7 +218,7 @@
|
||||
{/if}
|
||||
|
||||
<div class="line-clamp-1">
|
||||
{decodeURIComponent(item?.name)}
|
||||
{decodeString(item?.name)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -87,6 +87,14 @@
|
||||
showRelevance = calculateShowRelevance(citations);
|
||||
showPercentage = shouldShowPercentage(citations);
|
||||
}
|
||||
|
||||
const decodeString = (str: string) => {
|
||||
try {
|
||||
return decodeURIComponent(str);
|
||||
} catch (e) {
|
||||
return str;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<CitationsModal
|
||||
@@ -117,7 +125,7 @@
|
||||
<div
|
||||
class="flex-1 mx-1 truncate text-black/60 hover:text-black dark:text-white/60 dark:hover:text-white transition"
|
||||
>
|
||||
{decodeURIComponent(citation.source.name)}
|
||||
{decodeString(citation.source.name)}
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
@@ -157,7 +165,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
<div class="flex-1 mx-1 truncate">
|
||||
{decodeURIComponent(citation.source.name)}
|
||||
{decodeString(citation.source.name)}
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
@@ -194,7 +202,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
<div class="flex-1 mx-1 truncate">
|
||||
{decodeURIComponent(citation.source.name)}
|
||||
{decodeString(citation.source.name)}
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
|
||||
@@ -45,6 +45,14 @@
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const decodeString = (str: string) => {
|
||||
try {
|
||||
return decodeURIComponent(str);
|
||||
} catch (e) {
|
||||
return str;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<Modal size="lg" bind:show>
|
||||
@@ -99,7 +107,7 @@
|
||||
: `#`}
|
||||
target="_blank"
|
||||
>
|
||||
{decodeURIComponent(document?.metadata?.name ?? document.source.name)}
|
||||
{decodeString(document?.metadata?.name ?? document.source.name)}
|
||||
</a>
|
||||
{#if document?.metadata?.page}
|
||||
<span class="text-xs text-gray-500 dark:text-gray-400">
|
||||
|
||||
Reference in New Issue
Block a user