fix: plugin run & setting quote variables (#2150)

* fix

* fix

* change variables & variablelabels show condition

* fix type

* fix
This commit is contained in:
heheer
2024-07-25 18:01:43 +08:00
committed by GitHub
parent 55cefccad1
commit 5906daff9f
12 changed files with 89 additions and 51 deletions

View File

@@ -229,6 +229,24 @@ export const updatePluginInputByVariables = (
);
};
export const filterPluginInputVariables = (
variables: Record<string, any>,
nodes: RuntimeNodeItemType[]
) => {
const pluginInputNode = nodes.find((node) => node.flowNodeType === FlowNodeTypeEnum.pluginInput);
if (!pluginInputNode) return variables;
return Object.keys(variables).reduce(
(acc, key) => {
if (!pluginInputNode.inputs.find((input) => input.key === key)) {
acc[key] = variables[key];
}
return acc;
},
{} as Record<string, any>
);
};
export function replaceVariableLabel({
text,
nodes,