feat(web): user profile info
This commit is contained in:
@@ -1589,6 +1589,11 @@ export const en = {
|
||||
created_at: 'Created At',
|
||||
updated_at: 'Last Updated',
|
||||
fullScreen: 'Full Screen',
|
||||
role: 'Role',
|
||||
domain: 'Domain',
|
||||
expertise: 'Expertise',
|
||||
interests: 'Interests',
|
||||
knowledge_tags: 'Knowledge Tags',
|
||||
|
||||
memoryWindow: "{{name}}'s Memory Overview",
|
||||
memory_insight: 'Overall Overview',
|
||||
|
||||
@@ -1550,6 +1550,11 @@ export const zh = {
|
||||
created_at: '创建时间',
|
||||
updated_at: '最后更新时间',
|
||||
fullScreen: '全屏',
|
||||
role: '角色',
|
||||
domain: '领域',
|
||||
expertise: '专业擅长',
|
||||
interests: '兴趣爱好',
|
||||
knowledge_tags: '知识标签',
|
||||
|
||||
memoryWindow: "{{name}} 的记忆之窗",
|
||||
memory_insight: '总体概述',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 18:33:30
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-03-27 11:11:09
|
||||
* @Last Modified time: 2026-04-10 18:40:52
|
||||
*/
|
||||
/**
|
||||
* End User Profile Component
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
} from '@/api/memory'
|
||||
import EndUserProfileModal from './EndUserProfileModal'
|
||||
import type { EndUser, EndUserProfileModalRef, EndUserProfileRef } from '../types'
|
||||
import Tag from '@/components/Tag';
|
||||
|
||||
/**
|
||||
* Component props
|
||||
@@ -56,14 +57,6 @@ const EndUserProfile = forwardRef<EndUserProfileRef, EndUserProfileProps>(({ cla
|
||||
setLoading(false)
|
||||
})
|
||||
}
|
||||
/** Format profile items for display */
|
||||
const formatItems = useCallback(() => {
|
||||
return ['other_name'].map(key => ({
|
||||
key,
|
||||
label: t(`userMemory.${key}`),
|
||||
children: String(data?.[key as keyof EndUser] || '-'),
|
||||
}))
|
||||
}, [data])
|
||||
/** Open edit modal */
|
||||
const handleEdit = () => {
|
||||
if (!data) return
|
||||
@@ -89,13 +82,31 @@ const EndUserProfile = forwardRef<EndUserProfileRef, EndUserProfileProps>(({ cla
|
||||
>
|
||||
{loading
|
||||
? <Skeleton />
|
||||
: <Flex vertical gap={20}>
|
||||
{formatItems().map(vo => (
|
||||
<div key={vo.key} className="rb:leading-5">
|
||||
<div className="rb:text-[#7B8085]">{vo.label}</div>
|
||||
<div className="rb:mt-0.5">{vo.children}</div>
|
||||
</div>
|
||||
))}
|
||||
: <Flex vertical gap={20} className="rb:leading-5">
|
||||
<div>
|
||||
<div className="rb:text-[#7B8085]">{t('userMemory.other_name')}</div>
|
||||
<div className="rb:mt-0.5">{data?.other_name || '-'}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="rb:text-[#7B8085]">{t('userMemory.role')}</div>
|
||||
<div className="rb:mt-0.5">{data?.profile?.role || '-'}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="rb:text-[#7B8085]">{t('userMemory.domain')}</div>
|
||||
<div className="rb:mt-0.5">{data?.profile?.domain || '-'}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="rb:text-[#7B8085]">{t('userMemory.expertise')}</div>
|
||||
<div className="rb:mt-0.5">{data?.profile?.expertise?.join(' | ') || '-'}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="rb:text-[#7B8085]">{t('userMemory.interests')}</div>
|
||||
<div className="rb:mt-0.5">{data?.profile?.interests?.join(' | ') || '-'}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="rb:text-[#7B8085]">{t('userMemory.knowledge_tags')}</div>
|
||||
<Flex wrap gap={4} className="rb:mt-0.5!">{data?.knowledge_tags?.map((tag: string) => <Tag>{tag}</Tag>) || '-'}</Flex>
|
||||
</div>
|
||||
|
||||
<div className="rb:text-[#7B8085] rb:text-[12px] rb:leading-4.5">
|
||||
{t('userMemory.updated_at')}: {data?.updated_at ? dayjs(data?.updated_at).format('YYYY/MM/DD HH:mm:ss') : ''}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 17:57:15
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-03-24 17:58:54
|
||||
* @Last Modified time: 2026-04-10 18:38:49
|
||||
*/
|
||||
/**
|
||||
* User Memory Detail Types
|
||||
@@ -176,6 +176,23 @@ export interface EndUser {
|
||||
end_user_id: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
profile: {
|
||||
role: string;
|
||||
domain: string;
|
||||
expertise: string[];
|
||||
interests: string[];
|
||||
};
|
||||
_updated_at: {
|
||||
profile: string;
|
||||
knowledge_tags: string;
|
||||
behavioral_hints: string;
|
||||
};
|
||||
knowledge_tags: string[];
|
||||
behavioral_hints: {
|
||||
learning_stage: string;
|
||||
preferred_depth: string;
|
||||
tone_preference: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* End user profile modal ref
|
||||
|
||||
Reference in New Issue
Block a user