gitlab-org--gitlab-foss/app/controllers/admin/builds_controller.rb
Katarzyna Kobierska 5813aec22d Add Pending Tab to Admin Builds
Add Pending Tab to Project Builds

Update CHANGELOG
2016-07-18 10:23:32 +02:00

25 lines
581 B
Ruby

class Admin::BuildsController < Admin::ApplicationController
def index
@scope = params[:scope]
@all_builds = Ci::Build
@builds = @all_builds.order('created_at DESC')
@builds =
case @scope
when 'pending'
@builds.pending.reverse_order
when 'running'
@builds.running.reverse_order
when 'finished'
@builds.finished
else
@builds
end
@builds = @builds.page(params[:page]).per(30)
end
def cancel_all
Ci::Build.running_or_pending.each(&:cancel)
redirect_to admin_builds_path
end
end