|
|
|
@@ -1,15 +1,24 @@ |
|
|
|
json.status 0 |
|
|
|
json.message "success" |
|
|
|
|
|
|
|
json.pipelines @pipelines.each do |pipeline| |
|
|
|
json.extract! pipeline, :id, :pipeline_name, :pipeline_status, :description, :file_name, :is_graphic_design, |
|
|
|
:repo_name, :repo_identifier, :branch, :event, :sha, :disable, :json, :yaml, :created_at, :updated_at |
|
|
|
repo_config = @disabled_workflows.select { |config| config.repo_id = pipeline.project.gpid } |
|
|
|
if repo_config.present? |
|
|
|
json.disable JSON.parse(repo_config.first.config)["DisabledWorkflows"].to_s.include?(pipeline.file_name.to_s.gsub(".gitea/workflows/", "")) |
|
|
|
else |
|
|
|
json.disable pipeline.disable |
|
|
|
json.projects @project_ids.each do |project_id| |
|
|
|
json.id project_id |
|
|
|
project = Project.find_by(id: project_id) |
|
|
|
if project.present? |
|
|
|
json.owner project.owner.name |
|
|
|
json.identifier project.identifier |
|
|
|
json.name project.name |
|
|
|
json.url "#{Rails.application.config_for(:configuration)['platform_url']}/#{project.owner.name}/#{project.identifier}" |
|
|
|
json.pipelines @pipelines.select { |p| p.repo_id == project_id }.each do |pipeline| |
|
|
|
json.extract! pipeline, :id, :project_id, :pipeline_name, :pipeline_status, :description, :file_name, :is_graphic_design, |
|
|
|
:repo_name, :repo_identifier, :branch, :event, :sha, :disable, :json, :yaml, :created_at, :updated_at |
|
|
|
repo_config = @disabled_workflows.select { |config| config.repo_id = pipeline.project.gpid } |
|
|
|
if repo_config.present? |
|
|
|
json.disable JSON.parse(repo_config.first.config)["DisabledWorkflows"].to_s.include?(pipeline.file_name.to_s.gsub(".gitea/workflows/", "")) |
|
|
|
else |
|
|
|
json.disable pipeline.disable |
|
|
|
end |
|
|
|
json.pipeline_type pipeline.pipeline_type |
|
|
|
json.run_data @run_result.select { |result| result[:filename] == pipeline.file_name }.first |
|
|
|
end |
|
|
|
end |
|
|
|
json.pipeline_type pipeline.pipeline_type |
|
|
|
json.run_data @run_result.select { |result| result[:filename] == pipeline.file_name }.first |
|
|
|
end |