mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-21 11:43:56 +00:00
perf: http body parse (#3357)
* perf: http body parse * perf: http body parse
This commit is contained in:
@@ -41,9 +41,10 @@ weight: 809
|
|||||||
9. 优化 - 支持 Markdown 文本分割时,只有标题,无内容。
|
9. 优化 - 支持 Markdown 文本分割时,只有标题,无内容。
|
||||||
10. 优化 - 字符串变量替换,未赋值的变量会转成 undefined,而不是保留原来 id 串。
|
10. 优化 - 字符串变量替换,未赋值的变量会转成 undefined,而不是保留原来 id 串。
|
||||||
11. 优化 - 全局变量默认值在 API 生效,并且自定义变量支持默认值。
|
11. 优化 - 全局变量默认值在 API 生效,并且自定义变量支持默认值。
|
||||||
12. 修复 - 分享链接点赞鉴权问题。
|
12. 优化 - 增加 HTTP Body 的 JSON 解析,正则将 undefined 转 null,减少 Body 解析错误。
|
||||||
13. 修复 - 对话页面切换自动执行应用时,会误触发非自动执行应用。
|
13. 修复 - 分享链接点赞鉴权问题。
|
||||||
14. 修复 - 语言播放鉴权问题。
|
14. 修复 - 对话页面切换自动执行应用时,会误触发非自动执行应用。
|
||||||
15. 修复 - 插件应用知识库引用上限始终为 3000
|
15. 修复 - 语言播放鉴权问题。
|
||||||
16. 修复 - 工作流编辑记录存储上限,去掉本地存储,增加异常离开时,强制自动保存。
|
16. 修复 - 插件应用知识库引用上限始终为 3000
|
||||||
17. 修复 - 工作流特殊变量替换问题。($开头的字符串无法替换)
|
17. 修复 - 工作流编辑记录存储上限,去掉本地存储,增加异常离开时,强制自动保存。
|
||||||
|
18. 修复 - 工作流特殊变量替换问题。($开头的字符串无法替换)
|
@@ -1,5 +1,5 @@
|
|||||||
import { ChatCompletionRequestMessageRoleEnum } from '../../ai/constants';
|
import { ChatCompletionRequestMessageRoleEnum } from '../../ai/constants';
|
||||||
import { NodeInputKeyEnum, NodeOutputKeyEnum } from '../constants';
|
import { NodeInputKeyEnum, NodeOutputKeyEnum, WorkflowIOValueTypeEnum } from '../constants';
|
||||||
import { FlowNodeTypeEnum } from '../node/constant';
|
import { FlowNodeTypeEnum } from '../node/constant';
|
||||||
import { StoreNodeItemType } from '../type/node';
|
import { StoreNodeItemType } from '../type/node';
|
||||||
import { StoreEdgeItemType } from '../type/edge';
|
import { StoreEdgeItemType } from '../type/edge';
|
||||||
@@ -279,6 +279,27 @@ export const getReferenceVariableValue = ({
|
|||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const formatVariableValByType = (val: any, valueType?: WorkflowIOValueTypeEnum) => {
|
||||||
|
if (!valueType) return val;
|
||||||
|
// Value type check, If valueType invalid, return undefined
|
||||||
|
if (valueType.startsWith('array') && !Array.isArray(val)) return undefined;
|
||||||
|
if (valueType === WorkflowIOValueTypeEnum.boolean && typeof val !== 'boolean') return undefined;
|
||||||
|
if (valueType === WorkflowIOValueTypeEnum.number && typeof val !== 'number') return undefined;
|
||||||
|
if (valueType === WorkflowIOValueTypeEnum.string && typeof val !== 'string') return undefined;
|
||||||
|
if (
|
||||||
|
[
|
||||||
|
WorkflowIOValueTypeEnum.object,
|
||||||
|
WorkflowIOValueTypeEnum.chatHistory,
|
||||||
|
WorkflowIOValueTypeEnum.datasetQuote,
|
||||||
|
WorkflowIOValueTypeEnum.selectApp,
|
||||||
|
WorkflowIOValueTypeEnum.selectDataset
|
||||||
|
].includes(valueType) &&
|
||||||
|
typeof val !== 'object'
|
||||||
|
)
|
||||||
|
return undefined;
|
||||||
|
|
||||||
|
return val;
|
||||||
|
};
|
||||||
// replace {{$xx.xx$}} variables for text
|
// replace {{$xx.xx$}} variables for text
|
||||||
export function replaceEditorVariable({
|
export function replaceEditorVariable({
|
||||||
text,
|
text,
|
||||||
@@ -308,7 +329,7 @@ export function replaceEditorVariable({
|
|||||||
if (!node) return;
|
if (!node) return;
|
||||||
|
|
||||||
const output = node.outputs.find((output) => output.id === id);
|
const output = node.outputs.find((output) => output.id === id);
|
||||||
if (output) return output.value;
|
if (output) return formatVariableValByType(output.value, output.valueType);
|
||||||
|
|
||||||
const input = node.inputs.find((input) => input.key === id);
|
const input = node.inputs.find((input) => input.key === id);
|
||||||
if (input) return getReferenceVariableValue({ value: input.value, nodes, variables });
|
if (input) return getReferenceVariableValue({ value: input.value, nodes, variables });
|
||||||
|
@@ -42,7 +42,8 @@ import {
|
|||||||
filterWorkflowEdges,
|
filterWorkflowEdges,
|
||||||
checkNodeRunStatus,
|
checkNodeRunStatus,
|
||||||
textAdaptGptResponse,
|
textAdaptGptResponse,
|
||||||
replaceEditorVariable
|
replaceEditorVariable,
|
||||||
|
formatVariableValByType
|
||||||
} from '@fastgpt/global/core/workflow/runtime/utils';
|
} from '@fastgpt/global/core/workflow/runtime/utils';
|
||||||
import { ChatNodeUsageType } from '@fastgpt/global/support/wallet/bill/type';
|
import { ChatNodeUsageType } from '@fastgpt/global/support/wallet/bill/type';
|
||||||
import { dispatchRunTools } from './agent/runTool/index';
|
import { dispatchRunTools } from './agent/runTool/index';
|
||||||
@@ -72,6 +73,7 @@ import { dispatchLoopEnd } from './loop/runLoopEnd';
|
|||||||
import { dispatchLoopStart } from './loop/runLoopStart';
|
import { dispatchLoopStart } from './loop/runLoopStart';
|
||||||
import { dispatchFormInput } from './interactive/formInput';
|
import { dispatchFormInput } from './interactive/formInput';
|
||||||
import { dispatchToolParams } from './agent/runTool/toolParams';
|
import { dispatchToolParams } from './agent/runTool/toolParams';
|
||||||
|
import { AppChatConfigType } from '@fastgpt/global/core/app/type';
|
||||||
|
|
||||||
const callbackMap: Record<FlowNodeTypeEnum, Function> = {
|
const callbackMap: Record<FlowNodeTypeEnum, Function> = {
|
||||||
[FlowNodeTypeEnum.workflowStart]: dispatchWorkflowStart,
|
[FlowNodeTypeEnum.workflowStart]: dispatchWorkflowStart,
|
||||||
@@ -685,7 +687,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get system variable */
|
/* get system variable */
|
||||||
export function getSystemVariable({
|
const getSystemVariable = ({
|
||||||
user,
|
user,
|
||||||
runningAppInfo,
|
runningAppInfo,
|
||||||
chatId,
|
chatId,
|
||||||
@@ -693,7 +695,7 @@ export function getSystemVariable({
|
|||||||
histories = [],
|
histories = [],
|
||||||
uid,
|
uid,
|
||||||
chatConfig
|
chatConfig
|
||||||
}: Props): SystemVariablesType {
|
}: Props): SystemVariablesType => {
|
||||||
const variables = chatConfig?.variables || [];
|
const variables = chatConfig?.variables || [];
|
||||||
const variablesMap = variables.reduce<Record<string, any>>((acc, item) => {
|
const variablesMap = variables.reduce<Record<string, any>>((acc, item) => {
|
||||||
acc[item.key] = valueTypeFormat(item.defaultValue, item.valueType);
|
acc[item.key] = valueTypeFormat(item.defaultValue, item.valueType);
|
||||||
@@ -709,10 +711,10 @@ export function getSystemVariable({
|
|||||||
histories,
|
histories,
|
||||||
cTime: getSystemTime(user.timezone)
|
cTime: getSystemTime(user.timezone)
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
/* Merge consecutive text messages into one */
|
/* Merge consecutive text messages into one */
|
||||||
export const mergeAssistantResponseAnswerText = (response: AIChatItemValueItemType[]) => {
|
const mergeAssistantResponseAnswerText = (response: AIChatItemValueItemType[]) => {
|
||||||
const result: AIChatItemValueItemType[] = [];
|
const result: AIChatItemValueItemType[] = [];
|
||||||
// 合并连续的text
|
// 合并连续的text
|
||||||
for (let i = 0; i < response.length; i++) {
|
for (let i = 0; i < response.length; i++) {
|
||||||
|
@@ -24,6 +24,7 @@ import { ReadFileBaseUrl } from '@fastgpt/global/common/file/constants';
|
|||||||
import { createFileToken } from '../../../../support/permission/controller';
|
import { createFileToken } from '../../../../support/permission/controller';
|
||||||
import { JSONPath } from 'jsonpath-plus';
|
import { JSONPath } from 'jsonpath-plus';
|
||||||
import type { SystemPluginSpecialResponse } from '../../../../../plugins/type';
|
import type { SystemPluginSpecialResponse } from '../../../../../plugins/type';
|
||||||
|
import json5 from 'json5';
|
||||||
|
|
||||||
type PropsArrType = {
|
type PropsArrType = {
|
||||||
key: string;
|
key: string;
|
||||||
@@ -103,8 +104,6 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
|
|||||||
[NodeInputKeyEnum.addInputParam]: concatVariables,
|
[NodeInputKeyEnum.addInputParam]: concatVariables,
|
||||||
...concatVariables
|
...concatVariables
|
||||||
};
|
};
|
||||||
httpReqUrl = replaceVariable(httpReqUrl, allVariables);
|
|
||||||
|
|
||||||
const replaceStringVariables = (text: string) => {
|
const replaceStringVariables = (text: string) => {
|
||||||
return replaceVariable(
|
return replaceVariable(
|
||||||
replaceEditorVariable({
|
replaceEditorVariable({
|
||||||
@@ -116,6 +115,8 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
httpReqUrl = replaceStringVariables(httpReqUrl);
|
||||||
|
|
||||||
// parse header
|
// parse header
|
||||||
const headers = await (() => {
|
const headers = await (() => {
|
||||||
try {
|
try {
|
||||||
@@ -175,9 +176,11 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
|
|||||||
}
|
}
|
||||||
if (!httpJsonBody) return {};
|
if (!httpJsonBody) return {};
|
||||||
if (httpContentType === ContentTypes.json) {
|
if (httpContentType === ContentTypes.json) {
|
||||||
httpJsonBody = replaceVariable(httpJsonBody, allVariables);
|
httpJsonBody = replaceStringVariables(httpJsonBody);
|
||||||
// Json body, parse and return
|
// Json body, parse and return
|
||||||
const jsonParse = JSON.parse(httpJsonBody);
|
const jsonParse = json5.parse(
|
||||||
|
httpJsonBody.replace(/(".*?")\s*:\s*undefined\b/g, '$1: null')
|
||||||
|
);
|
||||||
const removeSignJson = removeUndefinedSign(jsonParse);
|
const removeSignJson = removeUndefinedSign(jsonParse);
|
||||||
return removeSignJson;
|
return removeSignJson;
|
||||||
}
|
}
|
||||||
@@ -195,7 +198,7 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
|
|||||||
return Object.fromEntries(requestBody);
|
return Object.fromEntries(requestBody);
|
||||||
} else if (typeof requestBody === 'string') {
|
} else if (typeof requestBody === 'string') {
|
||||||
try {
|
try {
|
||||||
return JSON.parse(requestBody);
|
return json5.parse(requestBody);
|
||||||
} catch {
|
} catch {
|
||||||
return { content: requestBody };
|
return { content: requestBody };
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,7 @@ export const iconPaths = {
|
|||||||
check: () => import('./icons/check.svg'),
|
check: () => import('./icons/check.svg'),
|
||||||
checkCircle: () => import('./icons/checkCircle.svg'),
|
checkCircle: () => import('./icons/checkCircle.svg'),
|
||||||
closeSolid: () => import('./icons/closeSolid.svg'),
|
closeSolid: () => import('./icons/closeSolid.svg'),
|
||||||
|
code: () => import('./icons/code.svg'),
|
||||||
collectionLight: () => import('./icons/collectionLight.svg'),
|
collectionLight: () => import('./icons/collectionLight.svg'),
|
||||||
collectionSolid: () => import('./icons/collectionSolid.svg'),
|
collectionSolid: () => import('./icons/collectionSolid.svg'),
|
||||||
comment: () => import('./icons/comment.svg'),
|
comment: () => import('./icons/comment.svg'),
|
||||||
@@ -58,8 +59,6 @@ export const iconPaths = {
|
|||||||
'common/monitor': () => import('./icons/common/monitor.svg'),
|
'common/monitor': () => import('./icons/common/monitor.svg'),
|
||||||
'common/more': () => import('./icons/common/more.svg'),
|
'common/more': () => import('./icons/common/more.svg'),
|
||||||
'common/moreFill': () => import('./icons/common/moreFill.svg'),
|
'common/moreFill': () => import('./icons/common/moreFill.svg'),
|
||||||
'common/navbar/pluginFill': () => import('./icons/common/navbar/pluginFill.svg'),
|
|
||||||
'common/navbar/pluginLight': () => import('./icons/common/navbar/pluginLight.svg'),
|
|
||||||
'common/openai': () => import('./icons/common/openai.svg'),
|
'common/openai': () => import('./icons/common/openai.svg'),
|
||||||
'common/overviewLight': () => import('./icons/common/overviewLight.svg'),
|
'common/overviewLight': () => import('./icons/common/overviewLight.svg'),
|
||||||
'common/paramsLight': () => import('./icons/common/paramsLight.svg'),
|
'common/paramsLight': () => import('./icons/common/paramsLight.svg'),
|
||||||
@@ -94,9 +93,6 @@ export const iconPaths = {
|
|||||||
'common/wechatFill': () => import('./icons/common/wechatFill.svg'),
|
'common/wechatFill': () => import('./icons/common/wechatFill.svg'),
|
||||||
configmap: () => import('./icons/configmap.svg'),
|
configmap: () => import('./icons/configmap.svg'),
|
||||||
copy: () => import('./icons/copy.svg'),
|
copy: () => import('./icons/copy.svg'),
|
||||||
code: () => import('./icons/code.svg'),
|
|
||||||
preview: () => import('./icons/preview.svg'),
|
|
||||||
fullScreen: () => import('./icons/fullScreen.svg'),
|
|
||||||
'core/app/aiFill': () => import('./icons/core/app/aiFill.svg'),
|
'core/app/aiFill': () => import('./icons/core/app/aiFill.svg'),
|
||||||
'core/app/aiLight': () => import('./icons/core/app/aiLight.svg'),
|
'core/app/aiLight': () => import('./icons/core/app/aiLight.svg'),
|
||||||
'core/app/aiLightSmall': () => import('./icons/core/app/aiLightSmall.svg'),
|
'core/app/aiLightSmall': () => import('./icons/core/app/aiLightSmall.svg'),
|
||||||
@@ -129,6 +125,7 @@ export const iconPaths = {
|
|||||||
'core/app/type/plugin': () => import('./icons/core/app/type/plugin.svg'),
|
'core/app/type/plugin': () => import('./icons/core/app/type/plugin.svg'),
|
||||||
'core/app/type/pluginFill': () => import('./icons/core/app/type/pluginFill.svg'),
|
'core/app/type/pluginFill': () => import('./icons/core/app/type/pluginFill.svg'),
|
||||||
'core/app/type/simple': () => import('./icons/core/app/type/simple.svg'),
|
'core/app/type/simple': () => import('./icons/core/app/type/simple.svg'),
|
||||||
|
'core/app/type/simpleFill': () => import('./icons/core/app/type/simpleFill.svg'),
|
||||||
'core/app/type/workflow': () => import('./icons/core/app/type/workflow.svg'),
|
'core/app/type/workflow': () => import('./icons/core/app/type/workflow.svg'),
|
||||||
'core/app/type/workflowFill': () => import('./icons/core/app/type/workflowFill.svg'),
|
'core/app/type/workflowFill': () => import('./icons/core/app/type/workflowFill.svg'),
|
||||||
'core/app/variable/external': () => import('./icons/core/app/variable/external.svg'),
|
'core/app/variable/external': () => import('./icons/core/app/variable/external.svg'),
|
||||||
@@ -320,6 +317,7 @@ export const iconPaths = {
|
|||||||
'file/pdf': () => import('./icons/file/pdf.svg'),
|
'file/pdf': () => import('./icons/file/pdf.svg'),
|
||||||
'file/qaImport': () => import('./icons/file/qaImport.svg'),
|
'file/qaImport': () => import('./icons/file/qaImport.svg'),
|
||||||
'file/uploadFile': () => import('./icons/file/uploadFile.svg'),
|
'file/uploadFile': () => import('./icons/file/uploadFile.svg'),
|
||||||
|
fullScreen: () => import('./icons/fullScreen.svg'),
|
||||||
help: () => import('./icons/help.svg'),
|
help: () => import('./icons/help.svg'),
|
||||||
history: () => import('./icons/history.svg'),
|
history: () => import('./icons/history.svg'),
|
||||||
infoRounded: () => import('./icons/infoRounded.svg'),
|
infoRounded: () => import('./icons/infoRounded.svg'),
|
||||||
@@ -345,6 +343,7 @@ export const iconPaths = {
|
|||||||
'plugins/doc2x': () => import('./icons/plugins/doc2x.svg'),
|
'plugins/doc2x': () => import('./icons/plugins/doc2x.svg'),
|
||||||
'plugins/textEditor': () => import('./icons/plugins/textEditor.svg'),
|
'plugins/textEditor': () => import('./icons/plugins/textEditor.svg'),
|
||||||
point: () => import('./icons/point.svg'),
|
point: () => import('./icons/point.svg'),
|
||||||
|
preview: () => import('./icons/preview.svg'),
|
||||||
'price/bg': () => import('./icons/price/bg.svg'),
|
'price/bg': () => import('./icons/price/bg.svg'),
|
||||||
'price/right': () => import('./icons/price/right.svg'),
|
'price/right': () => import('./icons/price/right.svg'),
|
||||||
save: () => import('./icons/save.svg'),
|
save: () => import('./icons/save.svg'),
|
||||||
|
@@ -1,4 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
|
|
||||||
<path
|
|
||||||
d="M13.9765 20H9.99764V17.9556C9.99764 17.8624 9.98917 17.7693 9.97224 17.6762C9.95531 17.5831 9.92568 17.4942 9.88759 17.4053C9.84949 17.3164 9.80716 17.236 9.75214 17.1598C9.69711 17.0836 9.63785 17.0116 9.57013 16.9439C9.22727 16.6053 8.7278 16.4148 8.20716 16.4233C8.09288 16.4233 7.97859 16.436 7.86431 16.4571C7.75002 16.4783 7.63997 16.5079 7.52991 16.5503C7.41986 16.5926 7.31827 16.6392 7.21669 16.6984C7.1151 16.7577 7.02198 16.8254 6.93732 16.9016C6.70452 17.109 6.42939 17.4603 6.42939 17.9937V20H2.48018C2.39976 20 2.31933 19.9958 2.23891 19.9873C2.15849 19.9788 2.07806 19.9661 1.99764 19.9534C1.91722 19.9365 1.84103 19.9196 1.7606 19.8942C1.68441 19.8688 1.60822 19.8434 1.53203 19.8138C1.45584 19.7841 1.38388 19.746 1.31193 19.7079C1.23997 19.6698 1.17224 19.6275 1.10452 19.581C1.03679 19.5344 0.973301 19.4878 0.909809 19.437C0.846317 19.3862 0.787057 19.3312 0.727798 19.272C0.668539 19.2127 0.617745 19.1534 0.562719 19.0899C0.511925 19.0265 0.461132 18.963 0.418804 18.8952C0.372243 18.8275 0.329915 18.7598 0.291819 18.6878C0.253724 18.6159 0.219862 18.5439 0.185999 18.4677C0.15637 18.3915 0.12674 18.3153 0.105576 18.2392C0.0801791 18.163 0.0632479 18.0825 0.0463167 18.0021C0.0293855 17.9217 0.0166871 17.8413 0.0124543 17.7608C0.00398871 17.6804 -0.000244141 17.6 -0.000244141 17.5196V13.5746H2.03997C2.45055 13.5746 2.84843 13.4011 3.16166 13.0836C3.25055 12.9947 3.32674 12.9016 3.39446 12.7958C3.46219 12.6942 3.52145 12.5841 3.56801 12.4698C3.61457 12.3556 3.64843 12.237 3.67383 12.1143C3.69923 11.9915 3.70769 11.8688 3.70769 11.746C3.69076 10.7979 2.91193 9.99788 2.00187 9.99788H-0.000244141V6.01058C-0.000244141 5.84974 0.0166871 5.68889 0.0463167 5.52804C0.0801792 5.3672 0.12674 5.21481 0.190232 5.06667C0.253724 4.91852 0.329915 4.7746 0.423036 4.64339C0.516158 4.50794 0.621978 4.38519 0.736264 4.27513C0.85055 4.16508 0.977534 4.06349 1.11298 3.9746C1.24843 3.88571 1.39235 3.81376 1.5405 3.7545C1.68864 3.69524 1.84526 3.64868 2.00187 3.61905C2.15849 3.58942 2.31933 3.57249 2.48018 3.57672H5.30346V2.92487C5.30346 2.87831 5.30346 2.82751 5.30769 2.78095C5.31192 2.73439 5.31192 2.6836 5.32039 2.63704C5.32462 2.59048 5.33309 2.53968 5.33732 2.49312C5.34579 2.44656 5.35425 2.39577 5.36272 2.34921C5.37118 2.30265 5.38388 2.25608 5.39658 2.20952L5.43468 2.06984C5.44737 2.02328 5.46431 1.97672 5.48124 1.93016C5.49817 1.8836 5.5151 1.84127 5.53203 1.79471C5.54896 1.74815 5.57013 1.70582 5.59129 1.66349C5.61245 1.62116 5.63362 1.5746 5.65901 1.53228C5.68018 1.48995 5.70558 1.44762 5.73097 1.40529C5.75637 1.36296 5.78177 1.32487 5.8114 1.28254C5.83679 1.24444 5.86642 1.20212 5.89605 1.16402L5.98494 1.04974C6.01457 1.01164 6.04843 0.977778 6.0823 0.939683C6.11616 0.90582 6.15002 0.867725 6.18388 0.833862C6.21774 0.8 6.25584 0.766138 6.2897 0.736508C6.3278 0.702646 6.36166 0.673016 6.39976 0.643386L6.51404 0.554497C6.55214 0.524868 6.59446 0.499471 6.63256 0.474074C6.67065 0.448677 6.71298 0.42328 6.75531 0.397884C6.79764 0.372487 6.83997 0.351323 6.8823 0.325926C6.92462 0.304762 6.96695 0.283598 7.01351 0.262434C7.05584 0.24127 7.1024 0.224339 7.14896 0.207407C7.19552 0.190476 7.23785 0.173545 7.28441 0.156614C7.33097 0.139683 7.37753 0.126984 7.42409 0.114286L7.56378 0.0761905C7.61034 0.0634921 7.6569 0.0550265 7.70769 0.0465609C7.75849 0.0380953 7.80505 0.0296296 7.85161 0.0253968C7.89817 0.021164 7.94896 0.0126984 7.99552 0.00846564C8.04208 0.00423284 8.09288 0 8.13944 0H8.28335C9.86642 0.0296296 11.1574 1.3545 11.1574 2.96296V3.57249H13.9765C14.0569 3.57249 14.1373 3.57672 14.2177 3.58095C14.2982 3.58942 14.3786 3.59788 14.4548 3.61481C14.5352 3.63175 14.6114 3.64868 14.6876 3.66984C14.7638 3.691 14.84 3.72064 14.9162 3.75026C14.9923 3.77989 15.0643 3.81376 15.1363 3.85185C15.2082 3.88995 15.2759 3.93227 15.3437 3.9746C15.4114 4.01693 15.4749 4.06772 15.5384 4.11852C15.6019 4.16931 15.6611 4.22434 15.7162 4.27937C15.7712 4.33439 15.8262 4.39788 15.877 4.45714C15.9278 4.52064 15.9744 4.58413 16.0209 4.65185C16.0675 4.71958 16.1056 4.7873 16.1437 4.85926C16.1818 4.93122 16.2156 5.00317 16.2453 5.07936C16.2749 5.15556 16.3003 5.23175 16.3257 5.30794C16.3468 5.38413 16.368 5.46455 16.3807 5.54074C16.3976 5.62116 16.4061 5.69735 16.4146 5.77778C16.423 5.8582 16.423 5.93862 16.423 6.01905V8.84233H17.0326C18.6664 8.84233 19.9955 10.1376 19.9955 11.7291C19.9955 13.363 18.6834 14.6921 17.0707 14.6921H16.423V17.5153C16.4273 18.8825 15.3267 20 13.9765 20Z" />
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 4.4 KiB |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9614 7.58301L11.9095 5.63625C11.8856 4.73711 11.148 4.01469 10.2423 4.01469C9.33664 4.01469 8.59906 4.73711 8.57511 5.63625L8.52327 7.58301H4.5C4.22386 7.58301 4 7.80687 4 8.08301V10.3728C5.86427 10.4434 7.35394 11.977 7.35394 13.8586C7.35394 15.7401 5.86427 17.2737 4 17.3444V19.51C4 19.7862 4.22386 20.01 4.5 20.01H6.85111C6.97393 18.2442 8.44528 16.8499 10.2423 16.8499C12.0393 16.8499 13.5106 18.2442 13.6335 20.01H15.9269C16.2031 20.01 16.4269 19.7862 16.4269 19.51V15.6073L18.3634 15.5457C19.2691 15.5169 19.9954 14.7723 19.9954 13.8587C19.9954 12.9452 19.2691 12.2006 18.3634 12.1718L16.4269 12.1102V8.08301C16.4269 7.80687 16.2031 7.58301 15.9269 7.58301H11.9614ZM11.6418 22.01V20.2494C11.6418 19.4765 11.0152 18.8499 10.2423 18.8499C9.46938 18.8499 8.84281 19.4765 8.84281 20.2494V22.01H4.5C3.11929 22.01 2 20.8907 2 19.51V15.3469H3.8656C4.68759 15.3469 5.35394 14.6806 5.35394 13.8586C5.35394 13.0366 4.68759 12.3702 3.8656 12.3702L2 12.3702V8.08301C2 6.7023 3.11929 5.58301 4.5 5.58301H6.57582C6.62855 3.60333 8.24991 2.01469 10.2423 2.01469C12.2347 2.01469 13.8561 3.60333 13.9088 5.58301H15.9269C17.3077 5.58301 18.4269 6.7023 18.4269 8.08301V10.1728C20.4084 10.2358 21.9954 11.8619 21.9954 13.8587C21.9954 15.8556 20.4084 17.4817 18.4269 17.5447V19.51C18.4269 20.8907 17.3077 22.01 15.9269 22.01H11.6418Z" />
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,12 @@
|
|||||||
|
<svg viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="20" height="20" transform="translate(0.5 0.5)" fill="url(#paint0_linear_5846_2933)"/>
|
||||||
|
<path d="M9.96659 4.38986C10.2456 4.22877 10.6979 4.22877 10.9769 4.38986L15.2403 6.85129C15.7983 7.17346 15.7983 7.6958 15.2403 8.01796L11.0331 10.447C10.7541 10.6081 10.3017 10.6081 10.0227 10.447L5.75936 7.98557C5.20135 7.6634 5.20135 7.14107 5.75935 6.8189L9.96659 4.38986Z" fill="white"/>
|
||||||
|
<path d="M4.9906 9.46161C4.9906 9.01057 5.30725 8.82776 5.69785 9.05327L9.6388 11.3286C9.862 11.4574 10.0429 11.7708 10.0429 12.0286V16.1949C10.0429 16.6459 9.7263 16.8287 9.33569 16.6032L5.39475 14.3279C5.17154 14.1991 4.9906 13.8857 4.9906 13.6279V9.46161Z" fill="white"/>
|
||||||
|
<path d="M10.9563 12.06C10.9563 11.8023 11.1372 11.4889 11.3604 11.36L15.302 9.08435C15.6926 8.85883 16.0093 9.04165 16.0093 9.49268V13.6585C16.0093 13.9162 15.8283 14.2296 15.6051 14.3585L11.6635 16.6342C11.2729 16.8597 10.9563 16.6769 10.9563 16.2258V12.06Z" fill="white"/>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="paint0_linear_5846_2933" x1="10" y1="0" x2="3.05556" y2="18.3333" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#67BFFF"/>
|
||||||
|
<stop offset="1" stop-color="#5BA6FF"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
@@ -751,7 +751,6 @@
|
|||||||
"core.module.template.config_params": "Can configure application system parameters",
|
"core.module.template.config_params": "Can configure application system parameters",
|
||||||
"core.module.template.empty_plugin": "Blank plugin",
|
"core.module.template.empty_plugin": "Blank plugin",
|
||||||
"core.module.template.empty_workflow": "Blank workflow",
|
"core.module.template.empty_workflow": "Blank workflow",
|
||||||
"core.module.template.http body placeholder": "Same syntax as Apifox",
|
|
||||||
"core.module.template.self_input": "Plug-in input",
|
"core.module.template.self_input": "Plug-in input",
|
||||||
"core.module.template.self_output": "Custom plug-in output",
|
"core.module.template.self_output": "Custom plug-in output",
|
||||||
"core.module.template.system_config": "System configuration",
|
"core.module.template.system_config": "System configuration",
|
||||||
|
@@ -64,6 +64,7 @@
|
|||||||
"full_response_data": "Full Response Data",
|
"full_response_data": "Full Response Data",
|
||||||
"greater_than": "Greater Than",
|
"greater_than": "Greater Than",
|
||||||
"greater_than_or_equal_to": "Greater Than or Equal To",
|
"greater_than_or_equal_to": "Greater Than or Equal To",
|
||||||
|
"http_body_placeholder": "Similar syntax to APIFox, variable selection can be activated via /. \nString variables need to be enclosed in double quotes, other types of variables do not need to be enclosed in double quotes. \nPlease strictly check whether it conforms to JSON format.",
|
||||||
"http_extract_output": "Output field extraction",
|
"http_extract_output": "Output field extraction",
|
||||||
"http_extract_output_description": "Specified fields in the response value can be extracted through JSONPath syntax",
|
"http_extract_output_description": "Specified fields in the response value can be extracted through JSONPath syntax",
|
||||||
"http_raw_response_description": "Raw HTTP response. Only accepts string or JSON type response data.",
|
"http_raw_response_description": "Raw HTTP response. Only accepts string or JSON type response data.",
|
||||||
@@ -193,4 +194,4 @@
|
|||||||
"workflow.Switch_success": "Switch Successful",
|
"workflow.Switch_success": "Switch Successful",
|
||||||
"workflow.Team cloud": "Team Cloud",
|
"workflow.Team cloud": "Team Cloud",
|
||||||
"workflow.exit_tips": "Your changes have not been saved. 'Exit directly' will not save your edits."
|
"workflow.exit_tips": "Your changes have not been saved. 'Exit directly' will not save your edits."
|
||||||
}
|
}
|
||||||
|
@@ -750,7 +750,6 @@
|
|||||||
"core.module.template.config_params": "可以配置应用的系统参数",
|
"core.module.template.config_params": "可以配置应用的系统参数",
|
||||||
"core.module.template.empty_plugin": "空白插件",
|
"core.module.template.empty_plugin": "空白插件",
|
||||||
"core.module.template.empty_workflow": "空白工作流",
|
"core.module.template.empty_workflow": "空白工作流",
|
||||||
"core.module.template.http body placeholder": "与 Apifox 相同的语法",
|
|
||||||
"core.module.template.self_input": "插件输入",
|
"core.module.template.self_input": "插件输入",
|
||||||
"core.module.template.self_output": "插件输出",
|
"core.module.template.self_output": "插件输出",
|
||||||
"core.module.template.system_config": "系统配置",
|
"core.module.template.system_config": "系统配置",
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
"Variable_name": "变量名",
|
"Variable_name": "变量名",
|
||||||
"add_new_input": "新增输入",
|
"add_new_input": "新增输入",
|
||||||
"add_new_output": "新增输出",
|
"add_new_output": "新增输出",
|
||||||
|
"http_body_placeholder": "与 APIFox 类似的语法,可通过 / 来激活变量选择。字符串变量均需加双引号,其他类型变量无需加双引号。请严格检查是否符合 JSON 格式。",
|
||||||
"append_application_reply_to_history_as_new_context": "将该应用回复内容拼接到历史记录中,作为新的上下文返回",
|
"append_application_reply_to_history_as_new_context": "将该应用回复内容拼接到历史记录中,作为新的上下文返回",
|
||||||
"application_call": "应用调用",
|
"application_call": "应用调用",
|
||||||
"assigned_reply": "指定回复",
|
"assigned_reply": "指定回复",
|
||||||
@@ -193,4 +194,4 @@
|
|||||||
"workflow.Switch_success": "切换成功",
|
"workflow.Switch_success": "切换成功",
|
||||||
"workflow.Team cloud": "团队云端",
|
"workflow.Team cloud": "团队云端",
|
||||||
"workflow.exit_tips": "您的更改尚未保存,「直接退出」将不会保存您的编辑记录。"
|
"workflow.exit_tips": "您的更改尚未保存,「直接退出」将不会保存您的编辑记录。"
|
||||||
}
|
}
|
||||||
|
@@ -751,7 +751,6 @@
|
|||||||
"core.module.template.config_params": "可以設定應用程式的系統參數",
|
"core.module.template.config_params": "可以設定應用程式的系統參數",
|
||||||
"core.module.template.empty_plugin": "空白外掛程式",
|
"core.module.template.empty_plugin": "空白外掛程式",
|
||||||
"core.module.template.empty_workflow": "空白工作流程",
|
"core.module.template.empty_workflow": "空白工作流程",
|
||||||
"core.module.template.http body placeholder": "與 Apifox 相同的語法",
|
|
||||||
"core.module.template.self_input": "外掛程式輸入",
|
"core.module.template.self_input": "外掛程式輸入",
|
||||||
"core.module.template.self_output": "外掛程式輸出",
|
"core.module.template.self_output": "外掛程式輸出",
|
||||||
"core.module.template.system_config": "系統設定",
|
"core.module.template.system_config": "系統設定",
|
||||||
|
@@ -64,6 +64,7 @@
|
|||||||
"full_response_data": "完整回應資料",
|
"full_response_data": "完整回應資料",
|
||||||
"greater_than": "大於",
|
"greater_than": "大於",
|
||||||
"greater_than_or_equal_to": "大於或等於",
|
"greater_than_or_equal_to": "大於或等於",
|
||||||
|
"http_body_placeholder": "與 APIFox 類似的語法,可透過 / 來啟動變數選擇。\n字串變數均需加雙引號,其他類型變數無需加雙引號。\n請嚴格檢查是否符合 JSON 格式。",
|
||||||
"http_extract_output": "輸出欄位擷取",
|
"http_extract_output": "輸出欄位擷取",
|
||||||
"http_extract_output_description": "可以透過 JSONPath 語法來擷取回應值中的指定欄位",
|
"http_extract_output_description": "可以透過 JSONPath 語法來擷取回應值中的指定欄位",
|
||||||
"http_raw_response_description": "HTTP 請求的原始回應。僅接受字串或 JSON 類型回應資料。",
|
"http_raw_response_description": "HTTP 請求的原始回應。僅接受字串或 JSON 類型回應資料。",
|
||||||
@@ -193,4 +194,4 @@
|
|||||||
"workflow.Switch_success": "切換成功",
|
"workflow.Switch_success": "切換成功",
|
||||||
"workflow.Team cloud": "團隊雲端",
|
"workflow.Team cloud": "團隊雲端",
|
||||||
"workflow.exit_tips": "您的變更尚未儲存,「直接結束」將不會儲存您的編輯紀錄。"
|
"workflow.exit_tips": "您的變更尚未儲存,「直接結束」將不會儲存您的編輯紀錄。"
|
||||||
}
|
}
|
||||||
|
@@ -687,26 +687,24 @@ const RenderBody = ({
|
|||||||
<RenderForm nodeId={nodeId} input={formBody} variables={variables} />
|
<RenderForm nodeId={nodeId} input={formBody} variables={variables} />
|
||||||
)}
|
)}
|
||||||
{typeInput?.value === ContentTypes.json && (
|
{typeInput?.value === ContentTypes.json && (
|
||||||
<JSONEditor
|
<PromptEditor
|
||||||
bg={'white'}
|
bg={'white'}
|
||||||
defaultHeight={200}
|
showOpenModal={false}
|
||||||
resize
|
variableLabels={variables}
|
||||||
|
minH={200}
|
||||||
value={jsonBody.value}
|
value={jsonBody.value}
|
||||||
placeholder={t('common:core.module.template.http body placeholder')}
|
placeholder={t('workflow:http_body_placeholder')}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
startSts(() => {
|
onChangeNode({
|
||||||
onChangeNode({
|
nodeId,
|
||||||
nodeId,
|
type: 'updateInput',
|
||||||
type: 'updateInput',
|
key: jsonBody.key,
|
||||||
key: jsonBody.key,
|
value: {
|
||||||
value: {
|
...jsonBody,
|
||||||
...jsonBody,
|
value: e
|
||||||
value: e
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
variables={variables}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{(typeInput?.value === ContentTypes.xml || typeInput?.value === ContentTypes.raw) && (
|
{(typeInput?.value === ContentTypes.xml || typeInput?.value === ContentTypes.raw) && (
|
||||||
@@ -714,16 +712,14 @@ const RenderBody = ({
|
|||||||
value={jsonBody.value}
|
value={jsonBody.value}
|
||||||
placeholder={t('common:textarea_variable_picker_tip')}
|
placeholder={t('common:textarea_variable_picker_tip')}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
startSts(() => {
|
onChangeNode({
|
||||||
onChangeNode({
|
nodeId,
|
||||||
nodeId,
|
type: 'updateInput',
|
||||||
type: 'updateInput',
|
key: jsonBody.key,
|
||||||
key: jsonBody.key,
|
value: {
|
||||||
value: {
|
...jsonBody,
|
||||||
...jsonBody,
|
value: e
|
||||||
value: e
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
showOpenModal={false}
|
showOpenModal={false}
|
||||||
|
Reference in New Issue
Block a user