查询阶段返回流水线名称

This commit is contained in:
moshenglv 2021-01-18 09:58:33 +08:00
parent 2d99713cd0
commit c6aeecb33c
3 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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