mirror of
https://github.com/langgenius/dify.git
synced 2026-04-25 17:47:30 +08:00
Merge branch 'feat/parent-child-retrieval' of https://github.com/langgenius/dify into feat/parent-child-retrieval
This commit is contained in:
commit
c541d4aaa8
@ -338,7 +338,7 @@ export const OperationAction: FC<{
|
|||||||
<RiMoreFill className='w-4 h-4 text-text-components-button-secondary-text' />
|
<RiMoreFill className='w-4 h-4 text-text-components-button-secondary-text' />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
btnClassName={open => cn(isListScene ? s.actionIconWrapperList : s.actionIconWrapperDetail, open ? '!bg-gray-100 !shadow-none' : '!bg-transparent')}
|
btnClassName={open => cn(isListScene ? s.actionIconWrapperList : s.actionIconWrapperDetail, open ? '!hover:bg-state-base-hover !shadow-none' : '!bg-transparent')}
|
||||||
popupClassName='!w-full'
|
popupClassName='!w-full'
|
||||||
className={`flex justify-end !w-[200px] h-fit !z-20 ${className}`}
|
className={`flex justify-end !w-[200px] h-fit !z-20 ${className}`}
|
||||||
/>
|
/>
|
||||||
@ -371,7 +371,7 @@ export const OperationAction: FC<{
|
|||||||
|
|
||||||
export const renderTdValue = (value: string | number | null, isEmptyStyle = false) => {
|
export const renderTdValue = (value: string | number | null, isEmptyStyle = false) => {
|
||||||
return (
|
return (
|
||||||
<div className={cn(isEmptyStyle ? 'text-gray-400' : 'text-gray-700', s.tdValue)}>
|
<div className={cn(isEmptyStyle ? 'text-text-tertiary' : 'text-text-secondary', s.tdValue)}>
|
||||||
{value ?? '-'}
|
{value ?? '-'}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@ -418,7 +418,7 @@ const DocumentList: FC<IDocumentListProps> = ({
|
|||||||
const isGeneralMode = chunkingMode !== ChuckingMode.parentChild
|
const isGeneralMode = chunkingMode !== ChuckingMode.parentChild
|
||||||
const isQAMode = chunkingMode === ChuckingMode.qa
|
const isQAMode = chunkingMode === ChuckingMode.qa
|
||||||
const [localDocs, setLocalDocs] = useState<LocalDoc[]>(documents)
|
const [localDocs, setLocalDocs] = useState<LocalDoc[]>(documents)
|
||||||
const [enableSort, setEnableSort] = useState(false)
|
const [enableSort, setEnableSort] = useState(true)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLocalDocs(documents)
|
setLocalDocs(documents)
|
||||||
@ -426,7 +426,7 @@ const DocumentList: FC<IDocumentListProps> = ({
|
|||||||
|
|
||||||
const onClickSort = () => {
|
const onClickSort = () => {
|
||||||
setEnableSort(!enableSort)
|
setEnableSort(!enableSort)
|
||||||
if (!enableSort) {
|
if (enableSort) {
|
||||||
const sortedDocs = [...localDocs].sort((a, b) => dayjs(a.created_at).isBefore(dayjs(b.created_at)) ? -1 : 1)
|
const sortedDocs = [...localDocs].sort((a, b) => dayjs(a.created_at).isBefore(dayjs(b.created_at)) ? -1 : 1)
|
||||||
setLocalDocs(sortedDocs)
|
setLocalDocs(sortedDocs)
|
||||||
}
|
}
|
||||||
@ -497,7 +497,7 @@ const DocumentList: FC<IDocumentListProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div className='relative w-full h-full overflow-x-auto'>
|
<div className='relative w-full h-full overflow-x-auto'>
|
||||||
<table className={`min-w-[700px] max-w-full w-full border-collapse border-0 text-sm mt-3 ${s.documentTable}`}>
|
<table className={`min-w-[700px] max-w-full w-full border-collapse border-0 text-sm mt-3 ${s.documentTable}`}>
|
||||||
<thead className="h-8 leading-8 border-b border-gray-200 text-gray-500 font-medium text-xs uppercase">
|
<thead className="h-8 leading-8 border-b border-divider-subtle text-text-tertiary font-medium text-xs uppercase">
|
||||||
<tr>
|
<tr>
|
||||||
<td className='w-12'>
|
<td className='w-12'>
|
||||||
<div className='flex items-center' onClick={e => e.stopPropagation()}>
|
<div className='flex items-center' onClick={e => e.stopPropagation()}>
|
||||||
@ -519,22 +519,22 @@ const DocumentList: FC<IDocumentListProps> = ({
|
|||||||
<td className='w-24'>{t('datasetDocuments.list.table.header.words')}</td>
|
<td className='w-24'>{t('datasetDocuments.list.table.header.words')}</td>
|
||||||
<td className='w-44'>{t('datasetDocuments.list.table.header.hitCount')}</td>
|
<td className='w-44'>{t('datasetDocuments.list.table.header.hitCount')}</td>
|
||||||
<td className='w-44'>
|
<td className='w-44'>
|
||||||
<div className='flex justify-between items-center'>
|
<div className='flex items-center' onClick={onClickSort}>
|
||||||
{t('datasetDocuments.list.table.header.uploadTime')}
|
{t('datasetDocuments.list.table.header.uploadTime')}
|
||||||
<ArrowDownIcon className={cn('h-3 w-3 stroke-current stroke-2 cursor-pointer', enableSort ? 'text-gray-500' : 'text-gray-300')} onClick={onClickSort} />
|
<ArrowDownIcon className={cn('ml-0.5 h-3 w-3 stroke-current stroke-2 cursor-pointer', enableSort ? 'text-text-tertiary' : 'text-gray-300')} />
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className='w-40'>{t('datasetDocuments.list.table.header.status')}</td>
|
<td className='w-40'>{t('datasetDocuments.list.table.header.status')}</td>
|
||||||
<td className='w-20'>{t('datasetDocuments.list.table.header.action')}</td>
|
<td className='w-20'>{t('datasetDocuments.list.table.header.action')}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="text-gray-700">
|
<tbody className="text-text-secondary">
|
||||||
{localDocs.map((doc, index) => {
|
{localDocs.map((doc, index) => {
|
||||||
const isFile = doc.data_source_type === DataSourceType.FILE
|
const isFile = doc.data_source_type === DataSourceType.FILE
|
||||||
const fileType = isFile ? doc.data_source_detail_dict?.upload_file?.extension : ''
|
const fileType = isFile ? doc.data_source_detail_dict?.upload_file?.extension : ''
|
||||||
return <tr
|
return <tr
|
||||||
key={doc.id}
|
key={doc.id}
|
||||||
className={'border-b border-gray-200 h-8 hover:bg-gray-50 cursor-pointer'}
|
className={'border-b border-divider-subtle h-8 hover:bg-background-default-hover cursor-pointer'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
router.push(`/datasets/${datasetId}/documents/${doc.id}`)
|
router.push(`/datasets/${datasetId}/documents/${doc.id}`)
|
||||||
}}>
|
}}>
|
||||||
@ -573,13 +573,13 @@ const DocumentList: FC<IDocumentListProps> = ({
|
|||||||
popupContent={t('datasetDocuments.list.table.rename')}
|
popupContent={t('datasetDocuments.list.table.rename')}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className='p-1 rounded-md cursor-pointer hover:bg-black/5'
|
className='p-1 rounded-md cursor-pointer hover:bg-state-base-hover'
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
handleShowRenameModal(doc)
|
handleShowRenameModal(doc)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Edit03 className='w-4 h-4 text-gray-500' />
|
<Edit03 className='w-4 h-4 text-text-tertiary' />
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user