Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop

This commit is contained in:
2024-11-18 15:21:27 +08:00
15 changed files with 150 additions and 11 deletions

View File

@@ -0,0 +1,14 @@
json.filename file["filename"]
json.old_name file["old_name"]
json.index file["index"]
json.type file["type"]
json.is_bin file["is_bin"]
json.is_created file["is_created"]
json.is_deleted file["is_deleted"]
json.is_lfs_file file["is_lfs_file"]
json.is_renamed file["is_renamed"]
json.is_submodule file["is_submodule"]
json.additions file["additions"]
json.deletions file["deletions"]
json.changes file["changes"]
json.sha file["sha"]

View File

@@ -0,0 +1,10 @@
if params[:filepath].present?
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object
else
json.file_nums @result_object[:total_data].to_i
json.total_addition @result_object[:data]["total_addition"]
json.total_deletion @result_object[:data]["total_deletion"]
json.files @result_object[:data]["files"] do |file|
json.partial! "api/v1/projects/simple_gitea_file", file: file
end
end

View File

@@ -0,0 +1,12 @@
json.author do
json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Committer']), name: commit['Committer']['Name'] }
end
json.committer do
json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Committer']), name: commit['Committer']['Name'] }
end
json.timestamp render_unix_time(commit['Committer']['When'])
json.time_from_now time_from_now(commit['Committer']['When'])
json.created_at render_format_time_with_date(commit['Committer']['When'])
json.message commit['CommitMessage']
json.sha commit['Sha']

View File

@@ -0,0 +1,12 @@
if params[:filepath].present?
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @compare_result['Diff']
else
json.file_nums @compare_result[:total_data].to_i
json.total_addition @compare_result[:data]["total_addition"]
json.total_deletion @compare_result[:data]["total_deletion"]
json.files @compare_result[:data]["files"] do |file|
json.partial! "api/v1/projects/simple_gitea_file", file: file
end
end
json.status @merge_status
json.message @merge_message

View File

@@ -0,0 +1,10 @@
if params[:filepath].present?
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object
else
json.file_nums @result_object[:total_data].to_i
json.total_addition @result_object[:data]["total_addition"]
json.total_deletion @result_object[:data]["total_deletion"]
json.files @result_object[:data]["files"] do |file|
json.partial! "api/v1/projects/simple_gitea_file", file: file
end
end

View File

@@ -1,4 +1,5 @@
json.commits_count @compare_result['CommitsCount']
json.files_count @compare_result['FilesCount']
# json.commits @compare_result['Commits'], partial: 'pull_requests/commit', as: :commit
json.commits do
if @compare_result['Commits'].present?

View File

@@ -3,10 +3,10 @@ if @commit.blank? #如果有状态值,则表示报错了
json.total_count 0
json.commits []
else
json.files_count @commit_diff['NumFiles']
json.total_addition @commit_diff['TotalAddition']
json.total_deletion @commit_diff['TotalDeletion']
json.files @commit_diff['Files'], partial: 'pull_requests/diff_file', as: :file, locals: {sha: @sha}
# json.files_count @commit_diff['NumFiles']
# json.total_addition @commit_diff['TotalAddition']
# json.total_deletion @commit_diff['TotalDeletion']
# json.files @commit_diff['Files'], partial: 'pull_requests/diff_file', as: :file, locals: {sha: @sha}
json.partial! 'commit', commit: @commit, project: @project
json.parents @commit['parents'] do |parent|