fixed: 流水线执行计数器

This commit is contained in:
xxq250 2025-02-13 15:58:12 +08:00
parent 874e5eeade
commit 053afec587
2 changed files with 5 additions and 3 deletions

View File

@ -1,8 +1,9 @@
class Api::V1::Projects::Actions::RunsController < Api::V1::Projects::Actions::BaseController
def index
def index
@result_object = Api::V1::Projects::Actions::Runs::ListService.call(@project, {workflow: params[:workflow], page: page, limit: limit}, current_user&.gitea_token)
puts @result_object
@begin_num = (page.to_i -1) * limit.to_i
# puts @result_object
end
def create

View File

@ -1,6 +1,7 @@
json.total_data @result_object[:total_data].to_i
if @result_object[:data]["Runs"].present?
json.runs @result_object[:data]["Runs"].each do |run|
json.runs @result_object[:data]["Runs"].each_with_index.to_a do |run, index|
json.num @result_object[:total_data].to_i - @begin_num - index
json.workflow run["WorkflowID"]
json.index run["Index"]
json.title run["Title"]