debian-mirror-gitlab/app/controllers/admin/jobs_controller.rb

20 lines
553 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
2017-09-10 17:25:29 +05:30
class Admin::JobsController < Admin::ApplicationController
2015-12-23 02:04:40 +05:30
def index
2020-01-01 13:55:28 +05:30
# We need all builds for tabs counters
@all_builds = JobsFinder.new(current_user: current_user).execute
2015-12-23 02:04:40 +05:30
@scope = params[:scope]
2020-01-01 13:55:28 +05:30
@builds = JobsFinder.new(current_user: current_user, params: params).execute
@builds = @builds.eager_load_everything
2015-12-23 02:04:40 +05:30
@builds = @builds.page(params[:page]).per(30)
end
def cancel_all
Ci::Build.running_or_pending.each(&:cancel)
2018-11-18 11:00:15 +05:30
redirect_to admin_jobs_path, status: :see_other
2015-12-23 02:04:40 +05:30
end
end