Merge branch 'standalone_develop' into pm_project_develop

This commit is contained in:
2024-03-06 16:44:45 +08:00
6 changed files with 26 additions and 23 deletions

View File

@@ -1,19 +1,23 @@
json.total_data @result_object[:total_data].to_i
json.runs @result_object[:data]["Runs"].each do |run|
json.workflow run["WorkflowID"]
json.index run["Index"]
json.title run["Title"]
json.trigger_user do
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(run['TriggerUser']), name: run['TriggerUser']['Name'] }
end
if @result_object[:data]["Runs"].present?
json.runs @result_object[:data]["Runs"].each do |run|
json.workflow run["WorkflowID"]
json.index run["Index"]
json.title run["Title"]
json.trigger_user do
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(run['TriggerUser']), name: run['TriggerUser']['Name'] }
end
if run["Ref"].starts_with?("refs/tags")
json.ref run["Ref"].gsub!("/refs/tags/", "")
else
json.ref run["Ref"].gsub!("refs/heads/", "")
end
if run["Ref"].starts_with?("refs/tags")
json.ref run["Ref"].gsub!("/refs/tags/", "")
else
json.ref run["Ref"].gsub!("refs/heads/", "")
end
json.status run["Status"]
json.time_ago time_from_now(run["Stopped"])
json.holding_time run["Stopped"]-run["Started"]
json.status run["Status"]
json.time_ago time_from_now(run["Stopped"])
json.holding_time run["Stopped"]-run["Started"]
end
else
json.runs []
end