|
|
@@ -2,11 +2,11 @@ class Api::Pm::ActionRunsController < Api::Pm::BaseController |
|
|
before_action :require_login |
|
|
before_action :require_login |
|
|
|
|
|
|
|
|
def index |
|
|
def index |
|
|
render_error('请输入workflows') if params[:workflows].blank? |
|
|
|
|
|
|
|
|
tip_exception('请输入workflows') if params[:workflows].blank? |
|
|
@owner = Owner.find_by(login: params[:owner_id].to_s) || Owner.find_by(id: params[:owner_id].to_s) |
|
|
@owner = Owner.find_by(login: params[:owner_id].to_s) || Owner.find_by(id: params[:owner_id].to_s) |
|
|
render_error('组织未找到') if @owner.blank? |
|
|
|
|
|
|
|
|
tip_exception('组织未找到') if @owner.blank? |
|
|
action_runs = Gitea::ActionRun.where(owner_id: @owner.gitea_uid) |
|
|
action_runs = Gitea::ActionRun.where(owner_id: @owner.gitea_uid) |
|
|
group_data = action_runs.where(workflow_id: params[:workflows].to_s.split(",")).group(:workflow_id, :status).count |
|
|
|
|
|
|
|
|
group_data = action_runs.where(workflow_id: params[:workflows].to_s.split(",")).where(status: [1,2]).group(:workflow_id, :status).count |
|
|
@result = [] |
|
|
@result = [] |
|
|
params[:workflows].to_s.split(",").each do |file| |
|
|
params[:workflows].to_s.split(",").each do |file| |
|
|
last_action_run = action_runs.where(workflow_id: file).order(updated: :desc).first |
|
|
last_action_run = action_runs.where(workflow_id: file).order(updated: :desc).first |
|
|
|