fixed 节点增加属性,节点名称带上id

This commit is contained in:
2024-12-10 09:36:49 +08:00
parent 35c0ac4eec
commit 28f3395b05
5 changed files with 33 additions and 6 deletions

View File

@@ -101,6 +101,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
job_nodes.each do |job|
node = Action::Node.find_by(name: job["data"]["name"])
node.label = job["data"]["label"] if job["data"]["label"].present?
node.node_id = job["data"]["id"] if job["data"]["id"].present?
next if node.blank?
next_edge_nodes = JSON.parse(demo2.to_json)["edges"].select { |edge| edge["source"]["cell"].include?(job["id"]) }
node_ids = next_edge_nodes.map { |t| t["target"]["cell"] }
@@ -150,6 +151,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
node = Action::Node.find_by(name: input_node["data"]["name"])
next if node.blank?
node.label = input_node["data"]["label"] if input_node["data"]["label"].present?
node.node_id = input_node["data"]["id"] if input_node["data"]["id"].present?
run_values = {}
input_values = {}
if input_node["data"]["inputs"].present?
@@ -182,6 +184,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
node = Action::Node.find_by(name: input_node["data"]["name"])
return nil if node.blank?
node.label = input_node["data"]["label"] if input_node["data"]["label"].present?
node.node_id = input_node["data"]["id"] if input_node["data"]["id"].present?
run_values = {}
input_values = {}
if input_node["data"]["inputs"].present?