gitlab-org--gitlab-foss/app/controllers/admin/jobs_controller.rb

24 lines
656 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class Admin::JobsController < Admin::ApplicationController
BUILDS_PER_PAGE = 30
feature_category :continuous_integration
2015-12-04 06:55:23 -05:00
def index
# We need all builds for tabs counters
@all_builds = Ci::JobsFinder.new(current_user: current_user).execute
2015-12-04 06:55:23 -05:00
@scope = params[:scope]
@builds = Ci::JobsFinder.new(current_user: current_user, params: params).execute
@builds = @builds.eager_load_everything
@builds = @builds.page(params[:page]).per(BUILDS_PER_PAGE).without_count
2015-12-04 06:55:23 -05:00
end
def cancel_all
Ci::Build.running_or_pending.each(&:cancel)
2018-07-02 06:43:06 -04:00
redirect_to admin_jobs_path, status: :see_other
2015-12-04 06:55:23 -05:00
end
end