fix: educoder clone url
This commit is contained in:
parent
422549f9e7
commit
e0c47c2abd
|
@ -96,7 +96,7 @@ class RepositoriesController < ApplicationController
|
||||||
|
|
||||||
def commits
|
def commits
|
||||||
if @project.educoder?
|
if @project.educoder?
|
||||||
@hash_commit = nil
|
@commits = Educoder::Repository::Commits::ListService.call(@project&.project_educoder&.repo_name)
|
||||||
else
|
else
|
||||||
if params[:filepath].present?
|
if params[:filepath].present?
|
||||||
file_path_uri = URI.parse(URI.encode(params[:filepath].to_s.strip))
|
file_path_uri = URI.parse(URI.encode(params[:filepath].to_s.strip))
|
||||||
|
|
|
@ -1,6 +1,26 @@
|
||||||
if @hash_commit.blank? #如果有状态值,则表示报错了
|
if @hash_commit.blank? || @project.educoder? #如果有状态值,则表示报错了
|
||||||
json.total_count 0
|
json.total_count 0
|
||||||
json.commits []
|
json.commits do
|
||||||
|
json.array! @commits do |commit|
|
||||||
|
json.sha commit['id']
|
||||||
|
json.message commit['title']
|
||||||
|
json.time_from_now commit['time']
|
||||||
|
json.author do
|
||||||
|
json.id nil
|
||||||
|
json.login commit['author']['username']
|
||||||
|
json.name commit['author']['username']
|
||||||
|
json.type nil
|
||||||
|
json.image_url commit['author']['image_url']
|
||||||
|
end
|
||||||
|
json.commiter do
|
||||||
|
json.id nil
|
||||||
|
json.login commit['author']['username']
|
||||||
|
json.name commit['author']['username']
|
||||||
|
json.type nil
|
||||||
|
json.image_url commit['author']['image_url']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
json.total_count @hash_commit[:total_count]
|
json.total_count @hash_commit[:total_count]
|
||||||
json.commits do
|
json.commits do
|
||||||
|
|
|
@ -44,7 +44,7 @@ end
|
||||||
if @result[:repo]
|
if @result[:repo]
|
||||||
json.size replace_bytes_to_b(number_to_human_size(@result[:repo]['size'].to_i*1024))
|
json.size replace_bytes_to_b(number_to_human_size(@result[:repo]['size'].to_i*1024))
|
||||||
json.ssh_url @result[:repo]['ssh_url']
|
json.ssh_url @result[:repo]['ssh_url']
|
||||||
json.clone_url @result[:repo]['clone_url']
|
json.clone_url @project.educoder? ? "#{Rails.application.config_for(:configuration)['educoder']['git_site']}/#{@project&.project_educoder&.repo_name}.git" : @result[:repo]['clone_url']
|
||||||
json.default_branch @project.educoder? ? "master" : @result[:repo]['default_branch']
|
json.default_branch @project.educoder? ? "master" : @result[:repo]['default_branch']
|
||||||
json.empty @result[:repo]['empty']
|
json.empty @result[:repo]['empty']
|
||||||
json.full_name @result[:repo]['full_name']
|
json.full_name @result[:repo]['full_name']
|
||||||
|
|
|
@ -7,7 +7,7 @@ if @project.educoder?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
json.commits_count @entries['commit_count']
|
json.commits_count @entries['commit_count']
|
||||||
json.zip_url @entries['git_url']
|
json.zip_url ''
|
||||||
json.tar_url ''
|
json.tar_url ''
|
||||||
json.entries do
|
json.entries do
|
||||||
json.array! @entries['trees'] do |entry|
|
json.array! @entries['trees'] do |entry|
|
||||||
|
|
Loading…
Reference in New Issue