Fix variable typo (#8084)
This commit is contained in:
parent
b1918dae5e
commit
2d7954c7da
215 changed files with 599 additions and 597 deletions
|
|
@ -24,7 +24,7 @@ import { ToastContext } from '@/app/components/base/toast'
|
|||
import type { Item } from '@/app/components/base/select'
|
||||
import { SimpleSelect } from '@/app/components/base/select'
|
||||
import { deleteSegment, disableSegment, enableSegment, fetchSegments, updateSegment } from '@/service/datasets'
|
||||
import type { SegmentDetailModel, SegmentUpdator, SegmentsQuery, SegmentsResponse } from '@/models/datasets'
|
||||
import type { SegmentDetailModel, SegmentUpdater, SegmentsQuery, SegmentsResponse } from '@/models/datasets'
|
||||
import { asyncRunSafe } from '@/utils'
|
||||
import type { CommonResponse } from '@/models/common'
|
||||
import AutoHeightTextarea from '@/app/components/base/auto-height-textarea/common'
|
||||
|
|
@ -322,7 +322,7 @@ const Completed: FC<ICompletedProps> = ({
|
|||
}
|
||||
|
||||
const handleUpdateSegment = async (segmentId: string, question: string, answer: string, keywords: string[]) => {
|
||||
const params: SegmentUpdator = { content: '' }
|
||||
const params: SegmentUpdater = { content: '' }
|
||||
if (docForm === 'qa_model') {
|
||||
if (!question.trim())
|
||||
return notify({ type: 'error', message: t('datasetDocuments.segment.questionEmpty') })
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import Button from '@/app/components/base/button'
|
|||
import AutoHeightTextarea from '@/app/components/base/auto-height-textarea/common'
|
||||
import { Hash02 } from '@/app/components/base/icons/src/vender/line/general'
|
||||
import { ToastContext } from '@/app/components/base/toast'
|
||||
import type { SegmentUpdator } from '@/models/datasets'
|
||||
import type { SegmentUpdater } from '@/models/datasets'
|
||||
import { addSegment } from '@/service/datasets'
|
||||
import TagInput from '@/app/components/base/tag-input'
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ const NewSegmentModal: FC<NewSegmentModalProps> = ({
|
|||
}
|
||||
|
||||
const handleSave = async () => {
|
||||
const params: SegmentUpdator = { content: '' }
|
||||
const params: SegmentUpdater = { content: '' }
|
||||
if (docForm === 'qa_model') {
|
||||
if (!question.trim())
|
||||
return notify({ type: 'error', message: t('datasetDocuments.segment.questionEmpty') })
|
||||
|
|
|
|||
|
|
@ -109,15 +109,15 @@ const Documents: FC<IDocumentsProps> = ({ datasetId }) => {
|
|||
let percent = 0
|
||||
const documentsData = documentsRes?.data?.map((documentItem) => {
|
||||
const { indexing_status, completed_segments, total_segments } = documentItem
|
||||
const isEmbeddinged = indexing_status === 'completed' || indexing_status === 'paused' || indexing_status === 'error'
|
||||
const isEmbedded = indexing_status === 'completed' || indexing_status === 'paused' || indexing_status === 'error'
|
||||
|
||||
if (isEmbeddinged)
|
||||
if (isEmbedded)
|
||||
completedNum++
|
||||
|
||||
const completedCount = completed_segments || 0
|
||||
const totalCount = total_segments || 0
|
||||
if (totalCount === 0 && completedCount === 0) {
|
||||
percent = isEmbeddinged ? 100 : 0
|
||||
percent = isEmbedded ? 100 : 0
|
||||
}
|
||||
else {
|
||||
const per = Math.round(completedCount * 100 / totalCount)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue