71777a4a18
Rename other URL generators admin_builds_path -> admin_jobs_path Fix tests and more renaming Fix more tests Also change build_id to job_id in the controller
25 lines
577 B
Ruby
25 lines
577 B
Ruby
class Admin::JobsController < 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_jobs_path
|
|
end
|
|
end
|