Merge branch 'pre_trustie_server' into trustie_server
This commit is contained in:
commit
ecde7be506
2
Gemfile
2
Gemfile
|
@ -141,4 +141,4 @@ gem 'doorkeeper'
|
|||
|
||||
gem 'doorkeeper-jwt'
|
||||
|
||||
gem 'gitea-client', '~> 1.5.7'
|
||||
gem 'gitea-client', '~> 1.5.8'
|
||||
|
|
|
@ -5,6 +5,17 @@ class Api::V1::Projects::Actions::RunsController < Api::V1::Projects::Actions::B
|
|||
puts @result_object
|
||||
end
|
||||
|
||||
def create
|
||||
return render_error("请输入正确的流水线文件!") if params[:workflow].blank?
|
||||
return render_error("请输入正确的分支!") if params[:ref].blank?
|
||||
gitea_result = $gitea_hat_client.post_repos_actions_runs_by_owner_repo(@project&.owner&.login, @project&.identifier, {query: {workflow: params[:workflow], ref: params[:ref]}})
|
||||
if gitea_result
|
||||
render_ok
|
||||
else
|
||||
ender_error("启动流水线任务失败")
|
||||
end
|
||||
end
|
||||
|
||||
def rerun
|
||||
return render_error("请输入正确的流水线记录ID!") if params[:run_id].blank?
|
||||
gitea_result = $gitea_hat_client.post_repos_actions_runs_rerun_by_owner_repo_run(@project&.owner&.login, @project&.identifier, params[:run_id]) rescue nil
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<li>
|
||||
<%= sidebar_item_group('#setting-index', '首页配置', icon: 'file', has_permission: current_user.admin? || current_user.business?) do %>
|
||||
<li><%= sidebar_item(admins_topic_banners_path, 'banner管理', icon: 'image', controller: 'admins-topic-banners', has_permission: current_user.admin? || current_user.business?) %></li>
|
||||
<li><%= sidebar_item(admins_topic_cards_path, '卡片管理', icon: 'archive', controller: 'admins-topic-cards', has_permission: current_user.admin? || current_user.business?) %></li>
|
||||
<!--<li><%#= sidebar_item(admins_topic_cards_path, '卡片管理', icon: 'archive', controller: 'admins-topic-cards', has_permission: current_user.admin? || current_user.business?) %></li>-->
|
||||
<li><%= sidebar_item(admins_topic_activity_forums_path, '平台动态管理', icon: 'bell', controller: 'admins-topic-activity_forums', has_permission: current_user.admin? || current_user.business?) %></li>
|
||||
<li><%= sidebar_item(admins_topic_excellent_projects_path, '优秀仓库管理', icon: 'git', controller: 'admins-topic-excellent_projects', has_permission: current_user.admin? || current_user.business?) %></li>
|
||||
<li><%= sidebar_item(admins_topic_pinned_forums_path, '精选文章管理', icon: 'edit', controller: 'admins-topic-pinned_forums', has_permission: current_user.admin? || current_user.business?) %></li>
|
||||
|
|
|
@ -5,5 +5,6 @@ json.projects @projects.each do |project|
|
|||
json.type project.numerical_for_project_type
|
||||
json.praised project.praised_by?(current_user)
|
||||
json.last_update_time render_unix_time(project.updated_on)
|
||||
json.full_last_update_time project.updated_on
|
||||
json.time_ago time_from_now(project.updated_on)
|
||||
end
|
|
@ -13,6 +13,7 @@ json.is_public project.is_public
|
|||
json.mirror_url project.repository&.mirror_url
|
||||
json.type project&.numerical_for_project_type
|
||||
json.last_update_time render_unix_time(project.updated_on)
|
||||
json.full_last_update_time project.updated_on
|
||||
json.time_ago time_from_now(project.updated_on)
|
||||
json.forked_from_project_id project.forked_from_project_id
|
||||
json.open_devops project.open_devops?
|
||||
|
|
|
@ -13,6 +13,7 @@ json.projects @projects do |project|
|
|||
json.mirror_url project.repository&.mirror_url
|
||||
json.type project&.numerical_for_project_type
|
||||
json.last_update_time render_unix_time(project.updated_on)
|
||||
json.full_last_update_time project.updated_on
|
||||
json.time_ago time_from_now(project.updated_on)
|
||||
json.forked_from_project_id project.forked_from_project_id
|
||||
json.open_devops project.open_devops?
|
||||
|
|
|
@ -95,7 +95,7 @@ defaults format: :json do
|
|||
collection do
|
||||
post :disable
|
||||
post :enable
|
||||
resources :runs, only: [:index] do
|
||||
resources :runs, only: [:index, :create] do
|
||||
post '/jobs/:job', to: 'runs#job_show'
|
||||
post '/rerun', to: 'runs#rerun'
|
||||
post '/jobs/:job/rerun', to: 'runs#job_rerun'
|
||||
|
|
Loading…
Reference in New Issue