mirror of https://github.com/langgenius/dify.git
Fix/24655 (#26527)
Co-authored-by: charles liu <dearcharles.liu@gmail.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
parent
9fed2dc065
commit
ae126fd56f
|
|
@ -75,6 +75,7 @@ dataset_detail_fields = {
|
||||||
"document_count": fields.Integer,
|
"document_count": fields.Integer,
|
||||||
"word_count": fields.Integer,
|
"word_count": fields.Integer,
|
||||||
"created_by": fields.String,
|
"created_by": fields.String,
|
||||||
|
"author_name": fields.String,
|
||||||
"created_at": TimestampField,
|
"created_at": TimestampField,
|
||||||
"updated_by": fields.String,
|
"updated_by": fields.String,
|
||||||
"updated_at": TimestampField,
|
"updated_at": TimestampField,
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,13 @@ class Dataset(Base):
|
||||||
def created_by_account(self):
|
def created_by_account(self):
|
||||||
return db.session.get(Account, self.created_by)
|
return db.session.get(Account, self.created_by)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def author_name(self) -> str | None:
|
||||||
|
account = db.session.get(Account, self.created_by)
|
||||||
|
if account:
|
||||||
|
return account.name
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def latest_process_rule(self):
|
def latest_process_rule(self):
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,9 @@ const DatasetCard = ({
|
||||||
}, [t, dataset.document_count, dataset.total_available_documents])
|
}, [t, dataset.document_count, dataset.total_available_documents])
|
||||||
|
|
||||||
const { formatTimeFromNow } = useFormatTimeFromNow()
|
const { formatTimeFromNow } = useFormatTimeFromNow()
|
||||||
|
const editTimeText = useMemo(() => {
|
||||||
|
return `${t('datasetDocuments.segment.editedAt')} ${formatTimeFromNow(dataset.updated_at * 1000)}`
|
||||||
|
}, [t, dataset.updated_at, formatTimeFromNow])
|
||||||
|
|
||||||
const openRenameModal = useCallback(() => {
|
const openRenameModal = useCallback(() => {
|
||||||
setShowRenameModal(true)
|
setShowRenameModal(true)
|
||||||
|
|
@ -193,6 +196,11 @@ const DatasetCard = ({
|
||||||
>
|
>
|
||||||
{dataset.name}
|
{dataset.name}
|
||||||
</div>
|
</div>
|
||||||
|
<div className='flex items-center gap-1 text-[10px] font-medium leading-[18px] text-text-tertiary'>
|
||||||
|
<div className='truncate' title={dataset.author_name}>{dataset.author_name}</div>
|
||||||
|
<div>·</div>
|
||||||
|
<div className='truncate' title={editTimeText}>{editTimeText}</div>
|
||||||
|
</div>
|
||||||
<div className='system-2xs-medium-uppercase flex items-center gap-x-3 text-text-tertiary'>
|
<div className='system-2xs-medium-uppercase flex items-center gap-x-3 text-text-tertiary'>
|
||||||
{isExternalProvider && <span>{t('dataset.externalKnowledgeBase')}</span>}
|
{isExternalProvider && <span>{t('dataset.externalKnowledgeBase')}</span>}
|
||||||
{!isExternalProvider && isShowDocModeInfo && (
|
{!isExternalProvider && isShowDocModeInfo && (
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ export type DataSet = {
|
||||||
permission: DatasetPermission
|
permission: DatasetPermission
|
||||||
data_source_type: DataSourceType
|
data_source_type: DataSourceType
|
||||||
indexing_technique: IndexingType
|
indexing_technique: IndexingType
|
||||||
|
author_name?: string
|
||||||
created_by: string
|
created_by: string
|
||||||
updated_by: string
|
updated_by: string
|
||||||
updated_at: number
|
updated_at: number
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue