mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
新增:分支同步历史记录以及创建同步分支接口
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
json.total_count @group_sync_repository_branch.keys.count
|
||||
json.sync_repository_branches @group_sync_repository_branch.each do |key|
|
||||
json.gitlink_branch_name key[0][0]
|
||||
json.external_branch_name key[0][1]
|
||||
branches = @sync_repository_branches.where(gitlink_branch_name: key[0][0], external_branch_name: key[0][1]).order(updated_at: :desc)
|
||||
json.total_count @group_sync_repository_branch.count
|
||||
json.sync_repository_branches @group_sync_repository_branch.each do |item|
|
||||
json.gitlink_branch_name item.gitlink_branch_name
|
||||
json.external_branch_name item.external_branch_name
|
||||
branches = @sync_repository_branches.where(gitlink_branch_name: item.gitlink_branch_name, external_branch_name: item.external_branch_name).order(updated_at: :desc)
|
||||
branch = branches.first
|
||||
json.type branch&.sync_repository&.type
|
||||
json.sync_time branch.sync_time
|
||||
json.sync_time branch.sync_time.strftime("%Y-%m-%d %H:%M:%S")
|
||||
json.sync_status branch.sync_status
|
||||
json.enable branch.enable
|
||||
json.reposync_branch_ids branches.pluck(:reposync_branch_id)
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
json.total_count @reposync_branch_logs.count
|
||||
json.logs @reposync_branch_logs.each do |log|
|
||||
type = log['repo_name'].start_with?('gitee') ? 'gitee' : 'github'
|
||||
json.change_from log['sync_direct'] == "to_inter" ? type : 'gitlink'
|
||||
json.commit_id log['commit_id']
|
||||
json.sync_time log['update_at']
|
||||
json.log log['log']
|
||||
end
|
||||
Reference in New Issue
Block a user