mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
Merge branch 'develop' into standalone_develop
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
|
||||
@@ -23,4 +23,14 @@ json.commit_time branch['commit']['timestamp']
|
||||
json.default_branch default_branch || nil
|
||||
json.http_url render_http_url(@project)
|
||||
json.zip_url render_zip_url(@owner, @project.repository, branch['name'])
|
||||
json.tar_url render_tar_url(@owner, @project.repository, branch['name'])
|
||||
json.tar_url render_tar_url(@owner, @project.repository, branch['name'])
|
||||
json.branch_id branch['id']
|
||||
json.is_deleted branch['is_deleted']
|
||||
json.deleted_unix branch['deleted_unix']
|
||||
json.deleted_by do
|
||||
if branch['is_deleted']
|
||||
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(branch['deleted_by']), name: branch['deleted_by']['name'] }
|
||||
else
|
||||
json.nil!
|
||||
end
|
||||
end
|
||||
13
app/views/api/v1/projects/commits/recent.json.jbuilder
Normal file
13
app/views/api/v1/projects/commits/recent.json.jbuilder
Normal file
@@ -0,0 +1,13 @@
|
||||
json.total_count @result_object[:total_data].to_i
|
||||
json.commits @result_object[:data].each do |commit|
|
||||
json.sha commit['sha']
|
||||
json.author do
|
||||
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(commit['commit']['author']), name: commit['commit']['author']['name'] }
|
||||
end
|
||||
|
||||
json.committer do
|
||||
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(commit['commit']['committer']), name: commit['commit']['committer']['name'] }
|
||||
end
|
||||
json.commit_message commit['commit']['message']
|
||||
json.parent_shas commit['parents'].map{|x|x['sha']}
|
||||
end
|
||||
@@ -14,5 +14,9 @@ json.commits @result_object['Commits'] do |commit|
|
||||
json.parent_shas commit['Sha']['ParentShas']
|
||||
end
|
||||
json.diff do
|
||||
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object['Diff']
|
||||
if @result_object['Diff'].present?
|
||||
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object['Diff']
|
||||
else
|
||||
json.nil!
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
json.total_count @result_object['total_count']
|
||||
json.sha @result_object['sha']
|
||||
json.entries @result_object['tree'].each do |entry|
|
||||
json.total_count @result_object[:data]['total_count'].to_i
|
||||
json.sha @result_object[:data]['sha']
|
||||
json.entries @result_object[:data]['tree'].each do |entry|
|
||||
json.name entry['path']
|
||||
json.mode entry['mode']
|
||||
json.type entry['type'] === 'blob' ? 'file' : 'dir'
|
||||
|
||||
Reference in New Issue
Block a user