mirror of https://github.com/langgenius/dify.git
fix: Add waiting state to document embedding process (#25478)
This commit is contained in:
commit
9458ebe320
|
|
@ -73,7 +73,6 @@ const EmbeddingProcess = ({
|
|||
return () => {
|
||||
clearTimeout(timeoutId)
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [shouldPoll])
|
||||
|
||||
// get rule
|
||||
|
|
@ -89,10 +88,16 @@ const EmbeddingProcess = ({
|
|||
router.push('/datasets?category=api')
|
||||
}
|
||||
|
||||
const isEmbeddingWaiting = useMemo(() => {
|
||||
if (!indexingStatusBatchDetail.length) return false
|
||||
return indexingStatusBatchDetail.every(indexingStatusDetail => ['waiting'].includes(indexingStatusDetail?.indexing_status || ''))
|
||||
}, [indexingStatusBatchDetail])
|
||||
const isEmbedding = useMemo(() => {
|
||||
if (!indexingStatusBatchDetail.length) return false
|
||||
return indexingStatusBatchDetail.some(indexingStatusDetail => ['indexing', 'splitting', 'parsing', 'cleaning'].includes(indexingStatusDetail?.indexing_status || ''))
|
||||
}, [indexingStatusBatchDetail])
|
||||
const isEmbeddingCompleted = useMemo(() => {
|
||||
if (!indexingStatusBatchDetail.length) return false
|
||||
return indexingStatusBatchDetail.every(indexingStatusDetail => ['completed', 'error', 'paused'].includes(indexingStatusDetail?.indexing_status || ''))
|
||||
}, [indexingStatusBatchDetail])
|
||||
|
||||
|
|
@ -125,10 +130,12 @@ const EmbeddingProcess = ({
|
|||
<>
|
||||
<div className='flex flex-col gap-y-3'>
|
||||
<div className='system-md-semibold-uppercase flex items-center gap-x-1 text-text-secondary'>
|
||||
{isEmbedding && (
|
||||
{(isEmbeddingWaiting || isEmbedding) && (
|
||||
<>
|
||||
<RiLoader2Fill className='size-4 animate-spin' />
|
||||
<span>{t('datasetDocuments.embedding.processing')}</span>
|
||||
<span>
|
||||
{isEmbeddingWaiting ? t('datasetDocuments.embedding.waiting') : t('datasetDocuments.embedding.processing')}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
{isEmbeddingCompleted && t('datasetDocuments.embedding.completed')}
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ const translation = {
|
|||
childMaxTokens: 'Kind',
|
||||
hierarchical: 'Eltern-Kind',
|
||||
pause: 'Pause',
|
||||
waiting: 'Einbettung wartet...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Absätze',
|
||||
|
|
|
|||
|
|
@ -318,6 +318,7 @@ const translation = {
|
|||
},
|
||||
},
|
||||
embedding: {
|
||||
waiting: 'Embedding waiting...',
|
||||
processing: 'Embedding processing...',
|
||||
paused: 'Embedding paused',
|
||||
completed: 'Embedding completed',
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ const translation = {
|
|||
childMaxTokens: 'Niño',
|
||||
hierarchical: 'Padre-hijo',
|
||||
parentMaxTokens: 'Padre',
|
||||
waiting: 'Esperando incrustación...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Párrafos',
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ const translation = {
|
|||
pause: 'مکث',
|
||||
childMaxTokens: 'کودک',
|
||||
hierarchical: 'پدر و مادر و فرزند',
|
||||
waiting: 'در حال انتظار برای جاسازی...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'پاراگرافها',
|
||||
|
|
|
|||
|
|
@ -340,6 +340,7 @@ const translation = {
|
|||
hierarchical: 'Parent-enfant',
|
||||
pause: 'Pause',
|
||||
parentMaxTokens: 'Parent',
|
||||
waiting: 'En attente d\'incorporation...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Paragraphes',
|
||||
|
|
|
|||
|
|
@ -340,6 +340,7 @@ const translation = {
|
|||
pause: 'रुकना',
|
||||
hierarchical: 'माता-पिता का बच्चा',
|
||||
childMaxTokens: 'बच्चा',
|
||||
waiting: 'इनपुट की प्रतीक्षा कर रहा हूं...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'पैराग्राफ',
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ const translation = {
|
|||
stop: 'Hentikan pemrosesan',
|
||||
custom: 'Adat',
|
||||
resume: 'Melanjutkan',
|
||||
waiting: 'Menunggu embedding...',
|
||||
},
|
||||
segment: {
|
||||
searchResults_one: 'HASIL',
|
||||
|
|
|
|||
|
|
@ -341,6 +341,7 @@ const translation = {
|
|||
pause: 'Pausa',
|
||||
hierarchical: 'Genitore-figlio',
|
||||
parentMaxTokens: 'Genitore',
|
||||
waiting: 'Attesa dell\'incorporamento...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Paragrafi',
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ const translation = {
|
|||
previewTip: '埋め込みが完了した後、段落のプレビューが利用可能になります',
|
||||
parentMaxTokens: '親',
|
||||
childMaxTokens: '子',
|
||||
waiting: '埋め込み待機中...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: '段落',
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ const translation = {
|
|||
parentMaxTokens: '부모',
|
||||
pause: '일시 중지',
|
||||
hierarchical: '부모 - 자식',
|
||||
waiting: '임베딩 대기 중...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: '단락',
|
||||
|
|
|
|||
|
|
@ -340,6 +340,7 @@ const translation = {
|
|||
hierarchical: 'Rodzic-dziecko',
|
||||
childMaxTokens: 'Dziecko',
|
||||
pause: 'Pauza',
|
||||
waiting: 'Oczekiwanie na osadzenie...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Akapity',
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ const translation = {
|
|||
hierarchical: 'Pai-filho',
|
||||
parentMaxTokens: 'Pai',
|
||||
childMaxTokens: 'Criança',
|
||||
waiting: 'Aguarde a incorporação...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Parágrafos',
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ const translation = {
|
|||
childMaxTokens: 'Copil',
|
||||
parentMaxTokens: 'Părinte',
|
||||
pause: 'Pauză',
|
||||
waiting: 'Așteptând încorporarea...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Paragrafe',
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ const translation = {
|
|||
childMaxTokens: 'Ребёнок',
|
||||
hierarchical: 'Родитель-дочерний',
|
||||
pause: 'Пауза',
|
||||
waiting: 'Ожидание встраивания...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Абзацы',
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ const translation = {
|
|||
childMaxTokens: 'Otrok',
|
||||
pause: 'Zaustavi',
|
||||
parentMaxTokens: 'Starš',
|
||||
waiting: 'Čakanje na zajemanje...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Odstavki',
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ const translation = {
|
|||
parentMaxTokens: 'พ่อแม่',
|
||||
pause: 'หยุด',
|
||||
hierarchical: 'พ่อแม่ลูก',
|
||||
waiting: 'กำลังรอสัญญาณ...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'ย่อหน้า',
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ const translation = {
|
|||
parentMaxTokens: 'Ebeveyn',
|
||||
hierarchical: 'Ebeveyn-çocuk',
|
||||
pause: 'Duraklat',
|
||||
waiting: 'Gömme bekleniyor...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Paragraflar',
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ const translation = {
|
|||
pause: 'Пауза',
|
||||
parentMaxTokens: 'Родитель',
|
||||
hierarchical: 'Батьки-діти',
|
||||
waiting: 'Виконання очікує...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Параграфи',
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ const translation = {
|
|||
pause: 'Tạm dừng',
|
||||
childMaxTokens: 'Con',
|
||||
hierarchical: 'Cha mẹ-con cái',
|
||||
waiting: 'Đang chờ nhúng...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: 'Đoạn văn',
|
||||
|
|
|
|||
|
|
@ -317,6 +317,7 @@ const translation = {
|
|||
},
|
||||
},
|
||||
embedding: {
|
||||
waiting: '嵌入等待中...',
|
||||
processing: '嵌入处理中...',
|
||||
paused: '嵌入已停止',
|
||||
completed: '嵌入已完成',
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ const translation = {
|
|||
parentMaxTokens: '父母',
|
||||
childMaxTokens: '孩子',
|
||||
pause: '暫停',
|
||||
waiting: '嵌入等待中...',
|
||||
},
|
||||
segment: {
|
||||
paragraphs: '段落',
|
||||
|
|
|
|||
Loading…
Reference in New Issue