From 2792c172d57e1fd2ad3fac5361dc049ac3ccb33f Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 10 Dec 2024 10:20:50 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E8=8A=82=E7=82=B9=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=B8=A6=E4=B8=8Aid,=E6=96=B9=E4=BE=BF=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E4=B8=AD=E7=8A=B6=E6=80=81=E8=AF=BB=E5=8F=96=EF=BC=8C=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E8=AF=BB=E5=8F=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/projects/pipelines_controller.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/v1/projects/pipelines_controller.rb b/app/controllers/api/v1/projects/pipelines_controller.rb index e4bf9dfc6..83926aed1 100644 --- a/app/controllers/api/v1/projects/pipelines_controller.rb +++ b/app/controllers/api/v1/projects/pipelines_controller.rb @@ -102,13 +102,12 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController node = Action::Node.find_by(name: job["data"]["name"]) next if node.blank? node.label = job["data"]["label"] if job["data"]["label"].present? - node.node_id = job["data"]["id"] if job["data"]["id"].present? + node.node_id = job["id"] if job["id"].present? 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"] } - next_step_node = JSON.parse(demo2.to_json)["nodes"].select { |node| node_ids.include?(node["data"]["id"]) && !node["data"]["name"].to_s.include?("job") }&.first + next_step_node = JSON.parse(demo2.to_json)["nodes"].select { |node| node_ids.include?(node["id"]) && !node["data"]["name"].to_s.include?("job") }&.first node.sub_nodes = [] get_all_child_nodes(node, next_step_node) if next_step_node.present? - Rails.logger.info "node.sub_nodes=========================#{node.sub_nodes}" @job_nodes.push(node) end yaml = ERB.new(File.read(File.join(Rails.root, "app/views/api/v1/projects/pipelines", "build_pipeline.yaml.erb"))).result(binding) @@ -152,7 +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? + node.node_id = input_node["id"] if input_node["id"].present? run_values = {} input_values = {} if input_node["data"]["inputs"].present? @@ -185,7 +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? + node.node_id = input_node["id"] if input_node["id"].present? run_values = {} input_values = {} if input_node["data"]["inputs"].present?