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
49c2309b
Commit
49c2309b
authored
Jul 26, 2023
by
jyong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/feat/milvus-support' into feat/milvus-support
parents
186573fa
216ea4ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
index.tsx
.../components/datasets/documents/detail/completed/index.tsx
+16
-3
dataset-documents.en.ts
web/i18n/lang/dataset-documents.en.ts
+4
-0
dataset-documents.zh.ts
web/i18n/lang/dataset-documents.zh.ts
+4
-0
No files found.
web/app/components/datasets/documents/detail/completed/index.tsx
View file @
49c2309b
...
...
@@ -101,7 +101,7 @@ export const SegmentDetail: FC<ISegmentDetailProps> = memo(({
<
AutoHeightTextarea
className=
'leading-6 text-md text-gray-800'
value=
{
question
}
placeholder=
{
t
(
'datasetDocuments.segment.
question
Placeholder'
)
||
''
}
placeholder=
{
t
(
'datasetDocuments.segment.
content
Placeholder'
)
||
''
}
onChange=
{
e
=>
setQuestion
(
e
.
target
.
value
)
}
disabled=
{
!
isEditing
}
autoFocus
...
...
@@ -262,9 +262,22 @@ const Completed: FC<ICompletedProps> = () => {
}
const
handleUpdateSegment
=
async
(
segmentId
:
string
,
question
:
string
,
answer
:
string
)
=>
{
const
params
:
SegmentUpdator
=
{
content
:
question
}
if
(
docForm
===
'qa_model'
)
const
params
:
SegmentUpdator
=
{
content
:
''
}
if
(
docForm
===
'qa_model'
)
{
if
(
!
question
.
trim
())
return
notify
({
type
:
'error'
,
message
:
t
(
'datasetDocuments.segment.questionEmpty'
)
})
if
(
!
answer
.
trim
())
return
notify
({
type
:
'error'
,
message
:
t
(
'datasetDocuments.segment.answerEmpty'
)
})
params
.
content
=
question
params
.
answer
=
answer
}
else
{
if
(
!
question
.
trim
())
return
notify
({
type
:
'error'
,
message
:
t
(
'datasetDocuments.segment.contentEmpty'
)
})
params
.
content
=
question
}
const
res
=
await
updateSegment
({
datasetId
,
documentId
,
segmentId
,
body
:
params
})
notify
({
type
:
'success'
,
message
:
t
(
'common.actionMsg.modifiedSuccessfully'
)
})
...
...
web/i18n/lang/dataset-documents.en.ts
View file @
49c2309b
...
...
@@ -311,7 +311,11 @@ const translation = {
hitCount
:
'hit count'
,
vectorHash
:
'Vector hash: '
,
questionPlaceholder
:
'add question here'
,
questionEmpty
:
'Question can not be empty'
,
answerPlaceholder
:
'add answer here'
,
answerEmpty
:
'Answer can not be empty'
,
contentPlaceholder
:
'add content here'
,
contentEmpty
:
'Content can not be empty'
,
},
}
...
...
web/i18n/lang/dataset-documents.zh.ts
View file @
49c2309b
...
...
@@ -310,7 +310,11 @@ const translation = {
hitCount
:
'命中次数'
,
vectorHash
:
'向量哈希:'
,
questionPlaceholder
:
'在这里添加问题'
,
questionEmpty
:
'问题不能为空'
,
answerPlaceholder
:
'在这里添加答案'
,
answerEmpty
:
'答案不能为空'
,
contentPlaceholder
:
'在这里添加内容'
,
contentEmpty
:
'内容不能为空'
,
},
}
...
...
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