mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
新增:流水线接口代码
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
json.total_count @data.size
|
||||
json.files @data.each do |file|
|
||||
json.name file["Name"]
|
||||
end
|
||||
19
app/views/api/v1/projects/actions/runs/index.json.jbuilder
Normal file
19
app/views/api/v1/projects/actions/runs/index.json.jbuilder
Normal file
@@ -0,0 +1,19 @@
|
||||
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 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"]
|
||||
end
|
||||
@@ -0,0 +1,16 @@
|
||||
json.state do
|
||||
json.run do
|
||||
json.title @result_object["state"]["run"]["title"]
|
||||
json.status @result_object["state"]["run"]["status"]
|
||||
json.done @result_object["state"]["run"]["done"]
|
||||
json.jobs @result_object["state"]["run"]["jobs"]
|
||||
json.current_job do
|
||||
json.title @result_object["state"]["currentJob"]["title"]
|
||||
json.detail @result_object["state"]["currentJob"]["detail"]
|
||||
json.steps @result_object["state"]["currentJob"]["steps"]
|
||||
end
|
||||
end
|
||||
end
|
||||
json.logs do
|
||||
json.steps_log @result_object["logs"]["stepsLog"]
|
||||
end
|
||||
Reference in New Issue
Block a user