Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
59e59c19
Unverified
Commit
59e59c19
authored
Jun 01, 2023
by
KVOJJJin
Committed by
GitHub
Jun 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: missing imports (#281)
parent
c67f626b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
index.tsx
.../components/datasets/documents/detail/embedding/index.tsx
+15
-12
No files found.
web/app/components/datasets/documents/detail/embedding/index.tsx
View file @
59e59c19
import
type
{
FC
}
from
'react'
import
React
,
{
useCallback
,
useMemo
,
useState
}
from
'react'
import
React
,
{
useCallback
,
use
Effect
,
use
Memo
,
useState
}
from
'react'
import
useSWR
from
'swr'
import
{
useRouter
}
from
'next/navigation'
import
{
useContext
}
from
'use-context-selector'
import
{
useTranslation
}
from
'react-i18next'
import
{
omit
}
from
'lodash-es'
import
cn
from
'classnames'
import
{
ArrowRightIcon
}
from
'@heroicons/react/24/solid'
import
{
useGetState
}
from
'ahooks'
import
cn
from
'classnames'
import
SegmentCard
from
'../completed/SegmentCard'
import
{
FieldInfo
}
from
'../metadata'
import
style
from
'../completed/style.module.css'
...
...
@@ -19,7 +20,7 @@ import type { FullDocumentDetail, ProcessRuleResponse } from '@/models/datasets'
import
type
{
CommonResponse
}
from
'@/models/common'
import
{
asyncRunSafe
}
from
'@/utils'
import
{
formatNumber
}
from
'@/utils/format'
import
{
fetchIndexingEstimate
,
fetchProcessRule
,
pauseDocIndexing
,
resumeDocIndexing
}
from
'@/service/datasets'
import
{
fetchIndexing
Status
as
doFetchIndexingStatus
,
fetchIndexing
Estimate
,
fetchProcessRule
,
pauseDocIndexing
,
resumeDocIndexing
}
from
'@/service/datasets'
import
DatasetDetailContext
from
'@/context/dataset-detail'
import
StopEmbeddingModal
from
'@/app/components/datasets/create/stop-embedding-modal'
...
...
@@ -134,11 +135,15 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: d
}
const
[
runId
,
setRunId
,
getRunId
]
=
useGetState
<
any
>
(
null
)
const
stopQueryStatus
=
()
=>
{
clearInterval
(
getRunId
())
}
const
startQueryStatus
=
()
=>
{
const
runId
=
setInterval
(()
=>
{
const
indexingStatusDetail
=
getIndexingStatusDetail
()
if
(
indexingStatusDetail
?.
indexing_status
===
'completed'
)
{
// eslint-disable-next-line @typescript-eslint/no-use-before-define
stopQueryStatus
()
return
}
...
...
@@ -146,9 +151,6 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: d
},
2500
)
setRunId
(
runId
)
}
const
stopQueryStatus
=
()
=>
{
clearInterval
(
getRunId
())
}
useEffect
(()
=>
{
fetchIndexingStatus
()
...
...
@@ -235,13 +237,14 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: d
key=
{
idx
}
className=
{
cn
(
s
.
progressBgItem
,
isEmbedding
?
'bg-primary-50'
:
'bg-gray-100'
)
}
/>)
}
<
div
className=
{
cn
(
'rounded-l-md'
,
<
div
className=
{
cn
(
'rounded-l-md'
,
s
.
progressBar
,
(
isEmbedding
||
isEmbeddingCompleted
)
&&
s
.
barProcessing
,
(
isEmbeddingPaused
||
isEmbeddingError
)
&&
s
.
barPaused
,
indexingStatusDetail
?.
indexing_status
===
'completed'
&&
'rounded-r-md'
)
}
indexingStatusDetail
?.
indexing_status
===
'completed'
&&
'rounded-r-md'
,
)
}
style=
{
{
width
:
`${percent}%`
}
}
/>
</
div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment