mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
enh: knowledge author info
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
import Search from '../icons/Search.svelte';
|
||||
import Plus from '../icons/Plus.svelte';
|
||||
import Spinner from '../common/Spinner.svelte';
|
||||
import { capitalizeFirstLetter } from '$lib/utils';
|
||||
import Tooltip from '../common/Tooltip.svelte';
|
||||
|
||||
let loaded = false;
|
||||
|
||||
@@ -137,7 +139,11 @@
|
||||
>
|
||||
<div class=" w-full">
|
||||
<div class="flex items-center justify-between -mt-1">
|
||||
<div class=" font-semibold line-clamp-1 h-fit">{item.name}</div>
|
||||
{#if item?.meta?.document}
|
||||
<Badge type="muted" content={$i18n.t('Document')} />
|
||||
{:else}
|
||||
<Badge type="success" content={$i18n.t('Collection')} />
|
||||
{/if}
|
||||
|
||||
<div class=" flex self-center">
|
||||
<ItemMenu
|
||||
@@ -150,17 +156,23 @@
|
||||
</div>
|
||||
|
||||
<div class=" self-center flex-1">
|
||||
<div class=" font-semibold line-clamp-1 h-fit">{item.name}</div>
|
||||
|
||||
<div class=" text-xs overflow-hidden text-ellipsis line-clamp-1">
|
||||
{item.description}
|
||||
</div>
|
||||
|
||||
<div class="mt-5 flex justify-between">
|
||||
<div>
|
||||
{#if item?.meta?.document}
|
||||
<Badge type="muted" content={$i18n.t('Document')} />
|
||||
{:else}
|
||||
<Badge type="success" content={$i18n.t('Collection')} />
|
||||
{/if}
|
||||
<div class="mt-3 flex justify-between">
|
||||
<div class="text-xs">
|
||||
<Tooltip
|
||||
content={item?.user?.email}
|
||||
className="flex shrink-0"
|
||||
placement="top-start"
|
||||
>
|
||||
{$i18n.t('By {{name}}', {
|
||||
name: capitalizeFirstLetter(item?.user?.name ?? item?.user?.email)
|
||||
})}
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div class=" text-xs text-gray-500 line-clamp-1">
|
||||
{$i18n.t('Updated')}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
import ChevronRight from '../icons/ChevronRight.svelte';
|
||||
import Switch from '../common/Switch.svelte';
|
||||
import Spinner from '../common/Spinner.svelte';
|
||||
import { capitalizeFirstLetter } from '$lib/utils';
|
||||
|
||||
let shiftKey = false;
|
||||
|
||||
@@ -288,7 +289,9 @@
|
||||
<div class="flex gap-1 text-xs overflow-hidden">
|
||||
<Tooltip content={model?.user?.email} className="flex shrink-0" placement="top-start">
|
||||
<div class="shrink-0 text-gray-500">
|
||||
By <span class=" capitalize">{model?.user?.name ?? model?.user?.email}</span>
|
||||
{$i18n.t('By {{name}}', {
|
||||
name: capitalizeFirstLetter(model?.user?.name ?? model?.user?.email)
|
||||
})}
|
||||
</div>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { TTS_RESPONSE_SPLIT } from '$lib/types';
|
||||
// Helper functions
|
||||
//////////////////////////
|
||||
|
||||
|
||||
export const replaceTokens = (content, char, user) => {
|
||||
const charToken = /{{char}}/gi;
|
||||
const userToken = /{{user}}/gi;
|
||||
|
||||
Reference in New Issue
Block a user