mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
4.8.8 test fix (#2149)
* perf: code comment * feat: system plugin input guide * perf: variable avatar * feat: feishu webhook * perf: select tool config tip * perf: rename variable * fix: per inherit error * perf: docker-compose oneapi version and i18n * perf: ui tip bug * fix: ts * perf: pg log * perf: editor color * perf: update init
This commit is contained in:
@@ -82,6 +82,7 @@ export async function getPluginPreviewNode({ id }: { id: string }): Promise<Flow
|
||||
avatar: plugin.avatar,
|
||||
name: plugin.name,
|
||||
intro: plugin.intro,
|
||||
inputExplanationUrl: plugin.inputExplanationUrl,
|
||||
showStatus: plugin.showStatus,
|
||||
isTool: plugin.isTool,
|
||||
version: plugin.version,
|
||||
|
@@ -262,13 +262,14 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
/* Inject data into module input */
|
||||
function getNodeRunParams(node: RuntimeNodeItemType) {
|
||||
if (node.flowNodeType === FlowNodeTypeEnum.pluginInput) {
|
||||
// Format plugin input to object
|
||||
return node.inputs.reduce<Record<string, any>>((acc, item) => {
|
||||
acc[item.key] = valueTypeFormat(item.value, item.valueType);
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
|
||||
// common nodes
|
||||
// Dynamic input need to store a key.
|
||||
const dynamicInput = node.inputs.find(
|
||||
(item) => item.renderTypeList[0] === FlowNodeInputTypeEnum.addInputParam
|
||||
);
|
||||
@@ -281,14 +282,14 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
node.inputs.forEach((input) => {
|
||||
if (input.key === dynamicInput?.key) return;
|
||||
|
||||
// replace {{}} variables
|
||||
// replace {{xx}} variables
|
||||
let value = replaceVariable(input.value, variables);
|
||||
|
||||
// replace {{$$}} variables
|
||||
// replace {{$xx.xx$}} variables
|
||||
value = replaceVariableLabel({
|
||||
text: value,
|
||||
nodes: runtimeNodes,
|
||||
variables: variables,
|
||||
variables,
|
||||
runningNode: node
|
||||
});
|
||||
|
||||
@@ -299,12 +300,11 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
variables
|
||||
});
|
||||
|
||||
// concat dynamic inputs
|
||||
// Dynamic input is stored in the dynamic key
|
||||
if (input.canEdit && dynamicInput && params[dynamicInput.key]) {
|
||||
params[dynamicInput.key][input.key] = valueTypeFormat(value, input.valueType);
|
||||
}
|
||||
|
||||
// Not dynamic input
|
||||
params[input.key] = valueTypeFormat(value, input.valueType);
|
||||
});
|
||||
|
||||
|
@@ -106,6 +106,7 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
|
||||
acc[key] = valueTypeFormat(value, WorkflowIOValueTypeEnum.string);
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
const requestBody = await (() => {
|
||||
if (!httpJsonBody) return {};
|
||||
try {
|
||||
|
Reference in New Issue
Block a user