-

- {!hasProgress && (!fileList || !fileList.length) &&
+

+ {(!isAutoUpload || !hasProgress && (!fileList || !fileList.length)) &&
<>
-
- {t('common.dragUploadTip')}
{t('common.uploadClickTip')}
+
+ {t('common.dragUploadTip')}{t('common.uploadClickTip')}
- {fileType &&
{t('common.supportedFileTypes', { types: fileType.join(',') })}
}
+ {fileType &&
{t('common.supportedFileTypes', { types: fileType.join(',') })}
}
{(fileSize || fileType || maxCount > 1) && (
{t('common.uploadFileTipMax', { max: fileSize, maxCount: maxCount })}
@@ -288,7 +292,7 @@ const UploadFiles = forwardRef
(({
)}
>
}
- {hasProgress && {t('common.uploading')}
}
+ {hasProgress && {t('common.uploading')}
}
diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts
index 8a5f1f38..94a90a56 100644
--- a/web/src/i18n/en.ts
+++ b/web/src/i18n/en.ts
@@ -426,6 +426,7 @@ export const en = {
fileAcceptTip: 'Unsupported file type:',
nextStep: 'Next Step',
prevStep: 'Previous Step',
+ exportSuccess: 'Export successful',
},
model: {
searchPlaceholder: 'search model…',
@@ -2472,6 +2473,11 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re
extract: 'Project Inference',
source: 'Not Added',
target: 'Added',
+ import: 'Import Scenario',
+ format: 'Export Format',
+ export: 'Export Scenario',
+ scene_id: 'Scenario',
+ file: 'Import File',
},
prompt: {
editor: 'Prompt Generator',
diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts
index d44aff70..30b4bbd2 100644
--- a/web/src/i18n/zh.ts
+++ b/web/src/i18n/zh.ts
@@ -980,6 +980,7 @@ export const zh = {
fileAcceptTip: '不支持的文件类型:',
nextStep: '下一步',
prevStep: '上一步',
+ exportSuccess: '导出成功',
},
product: {
applicationManagement: '应用管理',
@@ -2561,6 +2562,11 @@ export const zh = {
extract: '工程推理',
source: '未添加项',
target: '已添加项',
+ import: '导入场景',
+ format: '导出格式',
+ export: '导出场景',
+ scene_id: '场景',
+ file: '导入文件',
},
prompt: {
editor: '提示词生成器',
diff --git a/web/src/utils/request.ts b/web/src/utils/request.ts
index 7f85f4ce..3c3e8fa2 100644
--- a/web/src/utils/request.ts
+++ b/web/src/utils/request.ts
@@ -330,19 +330,20 @@ export const request = {
...config
});
},
- downloadFile(url: string, fileName: string, data?: unknown) {
+ downloadFile(url: string, fileName: string, data?: unknown, callback?: () => void) {
service.post(url, data, {
responseType: "blob",
})
.then(res =>{
const link = document.createElement("a");
- const blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
+ const blob = new Blob([res as unknown as BlobPart]);
link.style.display = "none";
link.href = URL.createObjectURL(blob);
- link.setAttribute("download", decodeURI(res.headers['filename'] || fileName));
+ link.setAttribute("download", decodeURI(fileName || fileName));
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
+ callback?.()
});
}
};
diff --git a/web/src/views/KnowledgeBase/[knowledgeBaseId]/CreateDataset.tsx b/web/src/views/KnowledgeBase/[knowledgeBaseId]/CreateDataset.tsx
index f876c51b..d2b1536f 100644
--- a/web/src/views/KnowledgeBase/[knowledgeBaseId]/CreateDataset.tsx
+++ b/web/src/views/KnowledgeBase/[knowledgeBaseId]/CreateDataset.tsx
@@ -24,7 +24,7 @@ const { TextArea } = Input;
const radioWrapperBaseStyle: React.CSSProperties = {
display: 'flex',
alignItems: 'flex-start',
- columnGap: 14, // 点与文字更宽的间距
+ columnGap: 14, // Wider gap between dot and text
width: '100%',
border: '1px solid #E5E5E5',
borderRadius: 8,
@@ -97,7 +97,7 @@ const CreateDataset = () => {
() => [
{ title: t('knowledgeBase.selectFile') },
{ title: t('knowledgeBase.parameterSettings') },
- // { title: t('knowledgeBase.dataPreview') }, // 暂时隐藏第三步
+ // { title: t('knowledgeBase.dataPreview') }, // Temporarily hide step 3
{ title: t('knowledgeBase.confirmUpload') },
],
[t],
@@ -105,27 +105,27 @@ const CreateDataset = () => {
// 存储每个文件的 AbortController,用于取消上传
const abortControllersRef = useRef
- {/* 文档预览 */}
+ {/* Document preview */}
{fileUrl && (