mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
Fix: websync doc and export dataset ux (#1225)
* Revert "lafAccount add pat & re request when token invalid (#76)" (#77) This reverts commit 83d85dfe37adcaef4833385ea52ee79fd84720be. * perf: workflow ux * system config * perf: export data * doc * update doc * fix: whisper
This commit is contained in:
@@ -566,6 +566,7 @@
|
||||
"Set Empty Result Tip": ",Response empty text",
|
||||
"Set Website Config": "Configuring Website",
|
||||
"Similarity": "Similarity",
|
||||
"Start export": "Export started",
|
||||
"Sync Time": "Update Time",
|
||||
"Table collection": "Table collection",
|
||||
"Text collection": "Text collection",
|
||||
@@ -965,6 +966,7 @@
|
||||
"AI support tool tip": "A model that supports function calls allows better use of tool calls.",
|
||||
"Ai chat": "LLM Chat",
|
||||
"Ai chat intro": "Request LLM chat",
|
||||
"App system setting": "",
|
||||
"Assigned reply": "Assigned reply",
|
||||
"Assigned reply intro": "The module can respond directly to a specified piece of content. Often used to guide and prompt. When non-string content is passed in, it is converted to a string for output.",
|
||||
"Basic Node": "Basic Node",
|
||||
|
@@ -566,6 +566,7 @@
|
||||
"Set Empty Result Tip": ",未搜索到内容时回复指定内容",
|
||||
"Set Website Config": "开始配置网站信息",
|
||||
"Similarity": "相关度",
|
||||
"Start export": "已开始导出",
|
||||
"Sync Time": "最后更新时间",
|
||||
"Table collection": "表格数据集",
|
||||
"Text collection": "文本数据集",
|
||||
@@ -610,7 +611,8 @@
|
||||
"success": "开始同步"
|
||||
}
|
||||
},
|
||||
"training": {}
|
||||
"training": {
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"Auxiliary Data": "辅助数据",
|
||||
@@ -966,6 +968,7 @@
|
||||
"AI support tool tip": "支持函数调用的模型,可以更好的使用工具调用。",
|
||||
"Ai chat": "AI 对话",
|
||||
"Ai chat intro": "AI 大模型对话",
|
||||
"App system setting": "系统配置",
|
||||
"Assigned reply": "指定回复",
|
||||
"Assigned reply intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
|
||||
"Basic Node": "基础功能",
|
||||
@@ -997,7 +1000,6 @@
|
||||
"Tool module": "工具",
|
||||
"UnKnow Module": "未知模块",
|
||||
"User guide": "用户引导",
|
||||
"App system setting": "系统配置",
|
||||
"http body placeholder": "与APIFox相同的语法",
|
||||
"textEditor": "文本加工",
|
||||
"textEditor intro": "可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。"
|
||||
|
@@ -71,7 +71,6 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
|
||||
cursor.on('end', () => {
|
||||
cursor.close();
|
||||
res.end();
|
||||
updateExportDatasetLimit(teamId);
|
||||
});
|
||||
|
||||
cursor.on('error', (err) => {
|
||||
@@ -79,6 +78,8 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
|
||||
res.status(500);
|
||||
res.end();
|
||||
});
|
||||
|
||||
updateExportDatasetLimit(teamId);
|
||||
} catch (err) {
|
||||
res.status(500);
|
||||
addLog.error(`export dataset error`, err);
|
||||
|
@@ -92,11 +92,17 @@ const Kb = () => {
|
||||
setLoading(true);
|
||||
await checkTeamExportDatasetLimit(dataset._id);
|
||||
|
||||
xmlDownloadFetch({
|
||||
await xmlDownloadFetch({
|
||||
url: `/api/core/dataset/exportAll?datasetId=${dataset._id}`,
|
||||
filename: `${dataset.name}.csv`
|
||||
});
|
||||
},
|
||||
onSuccess() {
|
||||
toast({
|
||||
status: 'success',
|
||||
title: t('core.dataset.Start export')
|
||||
});
|
||||
},
|
||||
onSettled() {
|
||||
setLoading(false);
|
||||
},
|
||||
|
@@ -1,20 +1,31 @@
|
||||
import { getToken } from '@/web/support/user/auth';
|
||||
import { hasHttps } from '@fastgpt/web/common/system/utils';
|
||||
|
||||
export const xmlDownloadFetch = ({ url, filename }: { url: string; filename: string }) => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
xhr.setRequestHeader('token', getToken());
|
||||
xhr.responseType = 'blob';
|
||||
xhr.onload = function (e) {
|
||||
if (this.status == 200) {
|
||||
const blob = this.response;
|
||||
const a = document.createElement('a');
|
||||
const url = URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
export const xmlDownloadFetch = async ({ url, filename }: { url: string; filename: string }) => {
|
||||
if (hasHttps()) {
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
} else {
|
||||
const response = await fetch(url, {
|
||||
headers: {
|
||||
token: `${getToken()}`
|
||||
}
|
||||
});
|
||||
if (!response.ok) throw new Error('Network response was not ok.');
|
||||
|
||||
const blob = await response.blob();
|
||||
const downloadUrl = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.style.display = 'none'; // 隐藏<a>元素
|
||||
a.href = downloadUrl;
|
||||
a.download = filename;
|
||||
document.body.appendChild(a);
|
||||
a.click(); // 模拟用户点击
|
||||
document.body.removeChild(a);
|
||||
window.URL.revokeObjectURL(downloadUrl); // 清理生成的URL
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user