mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-17 18:25:56 +08:00
Merge branch 'pre_trustie_server' into trustie_server
This commit is contained in:
4
app/views/api/v1/project_topics/index.json.jbuilder
Normal file
4
app/views/api/v1/project_topics/index.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.total_count @project_topics.total_count
|
||||
json.project_topics @project_topics.each do |topic|
|
||||
json.(topic, :id, :name, :projects_count)
|
||||
end
|
||||
@@ -3,7 +3,12 @@ json.type webhook["type"]
|
||||
json.content_type webhook['config']['content_type']
|
||||
json.http_method webhook['config']['http_method']
|
||||
json.url webhook['config']['url']
|
||||
json.events webhook['events']
|
||||
event = webhook.events
|
||||
if event["send_everything"]
|
||||
json.events event["events"].keys.collect{|i| %w(pull_request issues).include?(i) ? i + "_only" : i}
|
||||
else
|
||||
json.events event["events"].select{|k, v| v}.keys.collect{|i| %w(pull_request issues).include?(i) ? i + "_only" : i}
|
||||
end
|
||||
json.active webhook['active']
|
||||
json.branch_filter webhook['branch_filter']
|
||||
json.created_at format_time(webhook['created_at'].to_time)
|
||||
@@ -2,10 +2,15 @@ json.status 0
|
||||
json.message "success"
|
||||
json.data do
|
||||
json.array! @install_bots do |install_bot|
|
||||
json.installation_id install_bot.id
|
||||
json.extract! install_bot.bot, :id, :name
|
||||
json.bot_id install_bot.bot.id
|
||||
json.bot_name install_bot.bot.name
|
||||
|
||||
json.extract! install_bot, :id, :bot_id, :installer_id, :create_time, :update_time
|
||||
json.bot_name install_bot&.bot&.name
|
||||
json.account do
|
||||
user = User.find_by(id: install_bot.installer_id)
|
||||
if user.present?
|
||||
json.partial! "api/v1/users/simple_user", locals: {user: user}
|
||||
else
|
||||
json.nil!
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,5 +1,13 @@
|
||||
json.partial! "commons/success"
|
||||
|
||||
json.extract! @install_bot, :id, :bot_id, :installer_id, :state, :create_time, :update_time
|
||||
json.bot_name @install_bot.bot.name
|
||||
json.extract! @install_bot, :id, :bot_id, :installer_id, :create_time, :update_time
|
||||
json.bot_name @install_bot&.bot&.name
|
||||
json.account do
|
||||
user = User.find_by(id: @install_bot.installer_id)
|
||||
if user.present?
|
||||
json.partial! "api/v1/users/simple_user", locals: { user: user }
|
||||
else
|
||||
json.nil!
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -50,3 +50,6 @@ json.language do
|
||||
json.name project.project_language.name
|
||||
end
|
||||
end
|
||||
json.topics project.project_topics.each do |topic|
|
||||
json.(topic, :id, :name)
|
||||
end
|
||||
@@ -48,4 +48,7 @@ json.projects @projects do |project|
|
||||
json.name project.project_language.name
|
||||
end
|
||||
end
|
||||
json.topics project.project_topics.each do |topic|
|
||||
json.(topic, :id, :name)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,4 +6,7 @@ json.project_category_id @project.project_category_id
|
||||
json.project_language_id @project.project_language_id
|
||||
json.is_public @project.is_public
|
||||
json.website @project.website
|
||||
json.lesson_url @project.lesson_url
|
||||
json.lesson_url @project.lesson_url
|
||||
json.topics @project.project_topics.each do |topic|
|
||||
json.(topic, :id, :name)
|
||||
end
|
||||
@@ -5,7 +5,7 @@ json.create_time Time.at(@webhook.created_unix).strftime("%Y-%m-%d %H:%M:%S")
|
||||
event = @webhook.events
|
||||
json.branch_filter event["branch_filter"]
|
||||
if event["send_everything"]
|
||||
json.events event["events"].keys.collect{|i| i == "pull_request" ? i + "_only" : i}
|
||||
json.events event["events"].keys.collect{|i| %w(pull_request issues).include?(i) ? i + "_only" : i}
|
||||
else
|
||||
json.events event["events"].select{|k, v| v}.keys.collect{|i| i == "pull_request" ? i + "_only" : i}
|
||||
json.events event["events"].select{|k, v| v}.keys.collect{|i| %w(pull_request issues).include?(i) ? i + "_only" : i}
|
||||
end
|
||||
|
||||
@@ -21,6 +21,9 @@ json.mirror_url @project&.repository.remote_mirror_url
|
||||
json.mirror @project&.repository.mirror_url.present?
|
||||
json.type @project.numerical_for_project_type
|
||||
json.open_devops @project.open_devops?
|
||||
json.topics @project.project_topics.each do |topic|
|
||||
json.(topic, :id, :name)
|
||||
end
|
||||
|
||||
unless @project.common?
|
||||
json.mirror_status @repository.mirror_status
|
||||
|
||||
Reference in New Issue
Block a user