fixed 组织流水线列表接口,组织内所有仓库,分组显示

This commit is contained in:
2025-04-17 10:25:27 +08:00
parent 033c5cf191
commit aed452e144
2 changed files with 23 additions and 13 deletions

View File

@@ -5,7 +5,7 @@ class Api::Pm::PipelinesController < Api::Pm::BaseController
def index
@owner = Owner.find_by(login: params[:owner_id].to_s) || Owner.find_by(id: params[:owner_id].to_s)
tip_exception('组织未找到') if @owner.blank?
project_ids = @owner.projects.ids
@project_ids = @owner.projects.ids
project_gpids = @owner.projects.pluck(:gpid)
action_runs = Gitea::ActionRun.where(owner_id: @owner.gitea_uid)
group_data = action_runs.where(status: [1,2]).group(:workflow_id, :status).count
@@ -64,7 +64,8 @@ class Api::Pm::PipelinesController < Api::Pm::BaseController
end
Rails.logger.info("@run_result======#{@run_result}")
@disabled_workflows = Gitea::RepoUnit.where(repo_id: project_gpids, type: 10).where("config is not null")
@pipelines = Action::Pipeline.where(project_id: project_ids).order(updated_at: :desc)
@pipelines = Action::Pipeline.where(project_id: @project_ids).order(updated_at: :desc)
@pipelines = @pipelines
@pipelines = paginate @pipelines
end