fix: Show input names when node has multiple inputs (#10434)

This commit is contained in:
Michael Kret
2024-08-19 16:28:07 +03:00
committed by GitHub
parent aa4404ed79
commit 973956cc26
3 changed files with 62 additions and 4 deletions

View File

@@ -177,6 +177,26 @@ export const useNDVStore = defineStore(STORES.NDV, {
isNDVOpen(): boolean {
return this.activeNodeName !== null;
},
ndvNodeInputNumber() {
const returnData: { [nodeName: string]: number[] } = {};
const workflow = useWorkflowsStore().getCurrentWorkflow();
const activeNodeConections = (
workflow.connectionsByDestinationNode[this.activeNode?.name || ''] ?? {}
).main;
if (!activeNodeConections || activeNodeConections.length < 2) return returnData;
for (const [index, connection] of activeNodeConections.entries()) {
for (const node of connection) {
if (!returnData[node.node]) {
returnData[node.node] = [];
}
returnData[node.node].push(index + 1);
}
}
return returnData;
},
},
actions: {
setActiveNodeName(nodeName: string | null): void {