fixed 组织流水线中多仓库隔离,分页

This commit is contained in:
xxq250 2025-04-21 15:14:20 +08:00
parent a53f2e0eb9
commit 44396e444b
2 changed files with 2 additions and 1 deletions

View File

@ -59,7 +59,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
disabled_config = Gitea::RepoUnit.where(repo_id: @project.gpid, type: 10)&.first&.config disabled_config = Gitea::RepoUnit.where(repo_id: @project.gpid, type: 10)&.first&.config
@disabled_workflows = disabled_config.present? ? JSON.parse(disabled_config)["DisabledWorkflows"] : [] @disabled_workflows = disabled_config.present? ? JSON.parse(disabled_config)["DisabledWorkflows"] : []
@pipelines = Action::Pipeline.where(project_id: @project.id).order(updated_at: :desc) @pipelines = Action::Pipeline.where(project_id: @project.id).order(updated_at: :desc)
@pipelines = paginate @pipelines @pipelines = kaminari_paginate(@pipelines)
end end
def test_yaml def test_yaml

View File

@ -1,5 +1,6 @@
json.status 0 json.status 0
json.message "success" json.message "success"
json.count @pipelines.total_count
json.pipelines @pipelines.each do |pipeline| json.pipelines @pipelines.each do |pipeline|
json.extract! pipeline, :id, :pipeline_name, :pipeline_status, :description, :file_name, :is_graphic_design, json.extract! pipeline, :id, :pipeline_name, :pipeline_status, :description, :file_name, :is_graphic_design,