diff --git a/app/controllers/ci/pipelines_controller.rb b/app/controllers/ci/pipelines_controller.rb index 43b58e4c0..253d399d0 100644 --- a/app/controllers/ci/pipelines_controller.rb +++ b/app/controllers/ci/pipelines_controller.rb @@ -72,6 +72,7 @@ class Ci::PipelinesController < Ci::BaseController # =========阶段相关接口========= # def stages pipeline_id = params[:id] + @pipeline_name = Ci::Pipeline.find(pipeline_id).pipeline_name @pipeline_stages = Ci::PipelineStage.where('pipeline_id=?', pipeline_id).order('show_index asc') end @@ -171,8 +172,7 @@ class Ci::PipelinesController < Ci::BaseController steps.each do |step| pipeline_stage_step = Ci::PipelineStageStep.find(step[:id]) if pipeline_stage_step - pipeline_stage_step.update(step_name: step[:step_name], content: step[:content], - show_index: step[:show_index], template_id: step[:template_id]) + pipeline_stage_step.update(step_name: step[:step_name], content: step[:content], template_id: step[:template_id]) end end end diff --git a/app/views/ci/pipeline_stages/_list.json.jbuilder b/app/views/ci/pipeline_stages/_list.json.jbuilder index 1e782ee40..a0c8b314f 100644 --- a/app/views/ci/pipeline_stages/_list.json.jbuilder +++ b/app/views/ci/pipeline_stages/_list.json.jbuilder @@ -2,6 +2,7 @@ json.id pipeline_stage.id json.stage_name pipeline_stage.stage_name json.stage_type pipeline_stage.stage_type json.pipeline_id pipeline_stage.pipeline_id +json.pipeline_name pipeline_name json.show_index pipeline_stage.show_index json.created_at pipeline_stage.created_at json.updated_at pipeline_stage.updated_at diff --git a/app/views/ci/pipelines/stages.json.jbuilder b/app/views/ci/pipelines/stages.json.jbuilder index c7a65ecfe..74f27358a 100644 --- a/app/views/ci/pipelines/stages.json.jbuilder +++ b/app/views/ci/pipelines/stages.json.jbuilder @@ -1,3 +1,3 @@ json.stages @pipeline_stages do |pipeline_stage| - json.partial! "/ci/pipeline_stages/list", pipeline_stage: pipeline_stage + json.partial! "/ci/pipeline_stages/list", pipeline_stage: pipeline_stage, pipeline_name: @pipeline_name end \ No newline at end of file