Skip to content

Commit f1c7f0f

Browse files
committed
feat: add allow_download option to document form
1 parent b32b063 commit f1c7f0f

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

ui/src/locales/lang/en-US/views/document.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ export default {
158158
placeholder: 'Directly return segment content',
159159
requiredMessage: 'Please enter similarity value',
160160
},
161+
allow_download: {
162+
label: 'Allow download in knowledge base source',
163+
}
161164
},
162165
hitHandlingMethod: {
163166
optimization: 'Model optimization',

ui/src/locales/lang/zh-CN/views/document.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ export default {
151151
placeholder: '直接返回分段内容',
152152
requiredMessage: '请输入相似度',
153153
},
154+
allow_download: {
155+
label: '允许在知识库来源中下载',
156+
}
154157
},
155158
hitHandlingMethod: {
156159
optimization: '模型优化',

ui/src/locales/lang/zh-Hant/views/document.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ export default {
154154
placeholder: '直接返回分段内容',
155155
requiredMessage: '请输入相似度',
156156
},
157+
allow_download: {
158+
label: '允許在知識庫來源下載',
159+
}
157160
},
158161
hitHandlingMethod: {
159162
optimization: '模型優化',

ui/src/views/document/component/ImportDocumentDialog.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@
8080
/><span>{{ $t('views.document.form.similarity.placeholder') }}</span>
8181
</div>
8282
</el-form-item>
83+
<el-form-item prop="allow_download">
84+
<el-checkbox v-model="form.allow_download">
85+
{{ $t('views.document.form.allow_download.label') }}
86+
</el-checkbox>
87+
</el-form-item>
8388
</el-form>
8489
<template #footer>
8590
<span class="dialog-footer">
@@ -127,6 +132,7 @@ const form = ref<any>({
127132
selector: '',
128133
hit_handling_method: 'optimization',
129134
directly_return_similarity: 0.9,
135+
allow_download: false,
130136
})
131137
132138
// 文档设置
@@ -162,6 +168,7 @@ watch(dialogVisible, (bool) => {
162168
selector: '',
163169
hit_handling_method: 'optimization',
164170
directly_return_similarity: 0.9,
171+
allow_download: false,
165172
}
166173
isImport.value = false
167174
documentType.value = ''
@@ -200,6 +207,7 @@ const submit = async (formEl: FormInstance | undefined) => {
200207
const obj = {
201208
source_url_list: form.value.source_url.split('\n'),
202209
selector: form.value.selector,
210+
allow_download: form.value.allow_download,
203211
}
204212
loadSharedApi({ type: 'document', systemType: apiType.value })
205213
.postWebDocument(id, obj, loading)
@@ -219,6 +227,7 @@ const submit = async (formEl: FormInstance | undefined) => {
219227
...{
220228
source_url: form.value.source_url,
221229
selector: form.value.selector,
230+
allow_download: form.value.allow_download,
222231
},
223232
},
224233
}

0 commit comments

Comments
 (0)