-
+ const renderActionButtons = () => {
+ return (
+
+
-
-
-
-
- {
- docForm === 'qa_model'
- ? t('datasetDocuments.segment.newQaSegment')
- : t('datasetDocuments.segment.newTextSegment')
- }
-
-
-
-
{renderContent()}
-
{t('datasetDocuments.segment.keywords')}
-
+
+
+
+ )
+ }
+
+ const renderKeywords = () => {
+ return (
+
+
{t('datasetDocuments.segment.keywords')}
+
setKeywords(newKeywords)} />
-
-
-
-
-
+ )
+ }
+
+ return (
+
{}}
+ panelClassname={`!p-0 ${fullScreen
+ ? '!max-w-full !w-full'
+ : 'mt-16 mr-2 mb-2 !max-w-[560px] !w-[560px] border-[0.5px] border-components-panel-border rounded-xl'}`}
+ mask={false}
+ unmount
+ footer={null}
+ >
+
+
+
+
{
+ docForm === 'qa_model'
+ ? t('datasetDocuments.segment.newQaSegment')
+ : t('datasetDocuments.segment.addChunk')
+ }
+
+
+ ·
+ {formatNumber(question.length)} {t('datasetDocuments.segment.characters')}
+
+
+
+ {fullScreen && (
+ <>
+ {renderActionButtons()}
+
+ >
+ )}
+
+
+
+
+
+
+
+
+
+
+ {renderContent()}
+
+ {renderKeywords()}
+
+ {!fullScreen && (
+
+ {renderActionButtons()}
+
+ )}
+
+
)
}
diff --git a/web/i18n/en-US/dataset-documents.ts b/web/i18n/en-US/dataset-documents.ts
index df26449dc3..a0bcb5bba0 100644
--- a/web/i18n/en-US/dataset-documents.ts
+++ b/web/i18n/en-US/dataset-documents.ts
@@ -340,14 +340,15 @@ const translation = {
characters: 'characters',
hitCount: 'Retrieval count',
vectorHash: 'Vector hash: ',
- questionPlaceholder: 'add question here',
+ questionPlaceholder: 'Add question here',
questionEmpty: 'Question can not be empty',
- answerPlaceholder: 'add answer here',
+ answerPlaceholder: 'Add answer here',
answerEmpty: 'Answer can not be empty',
contentPlaceholder: 'Add content here',
contentEmpty: 'Content can not be empty',
newTextSegment: 'New Text Segment',
newQaSegment: 'New Q&A Segment',
+ addChunk: 'Add Chunk',
delete: 'Delete this chunk ?',
},
}
diff --git a/web/i18n/zh-Hans/dataset-documents.ts b/web/i18n/zh-Hans/dataset-documents.ts
index 35288c04d6..355c4bee7f 100644
--- a/web/i18n/zh-Hans/dataset-documents.ts
+++ b/web/i18n/zh-Hans/dataset-documents.ts
@@ -346,6 +346,7 @@ const translation = {
contentEmpty: '内容不能为空',
newTextSegment: '新文本分段',
newQaSegment: '新问答分段',
+ addChunk: '新增分段',
delete: '删除这个分段?',
},
}