From 44396e444b59f6e308f2464597cf2c1aec282d9b Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 21 Apr 2025 15:14:20 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E7=BB=84=E7=BB=87=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E7=BA=BF=E4=B8=AD=E5=A4=9A=E4=BB=93=E5=BA=93=E9=9A=94=E7=A6=BB?= =?UTF-8?q?=EF=BC=8C=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/projects/pipelines_controller.rb | 2 +- app/views/api/v1/projects/pipelines/index.json.jbuilder | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/projects/pipelines_controller.rb b/app/controllers/api/v1/projects/pipelines_controller.rb index 8414f676f..25b95e547 100644 --- a/app/controllers/api/v1/projects/pipelines_controller.rb +++ b/app/controllers/api/v1/projects/pipelines_controller.rb @@ -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_workflows = disabled_config.present? ? JSON.parse(disabled_config)["DisabledWorkflows"] : [] @pipelines = Action::Pipeline.where(project_id: @project.id).order(updated_at: :desc) - @pipelines = paginate @pipelines + @pipelines = kaminari_paginate(@pipelines) end def test_yaml diff --git a/app/views/api/v1/projects/pipelines/index.json.jbuilder b/app/views/api/v1/projects/pipelines/index.json.jbuilder index 81efa081a..65837ba7d 100644 --- a/app/views/api/v1/projects/pipelines/index.json.jbuilder +++ b/app/views/api/v1/projects/pipelines/index.json.jbuilder @@ -1,5 +1,6 @@ json.status 0 json.message "success" +json.count @pipelines.total_count json.pipelines @pipelines.each do |pipeline| json.extract! pipeline, :id, :pipeline_name, :pipeline_status, :description, :file_name, :is_graphic_design,