Browse Source

fixed: 流水线执行计数器

pull/347/head
xxq250 1 year ago
parent
commit
053afec587
2 changed files with 5 additions and 3 deletions
  1. +3
    -2
      app/controllers/api/v1/projects/actions/runs_controller.rb
  2. +2
    -1
      app/views/api/v1/projects/actions/runs/index.json.jbuilder

+ 3
- 2
app/controllers/api/v1/projects/actions/runs_controller.rb 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


+ 2
- 1
app/views/api/v1/projects/actions/runs/index.json.jbuilder 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"]


Loading…
Cancel
Save