Sha256: 26f5b4e9f10ce36fe2b8b8507ad5561db62f15be653c4ba63281bae39fc08a48

Contents?: true

Size: 649 Bytes

Versions: 12

Compression:

Stored size: 649 Bytes

Contents

class MissionControl::Jobs::WorkersController < MissionControl::Jobs::ApplicationController
  before_action :ensure_exposed_workers

  def index
    @workers_page = MissionControl::Jobs::Page.new(workers_relation, page: params[:page].to_i)
    @workers_count = @workers_page.total_count
  end

  def show
    @worker = MissionControl::Jobs::Current.server.find_worker(params[:id])
  end

  private
    def ensure_exposed_workers
      unless workers_exposed?
        redirect_to root_url, alert: "This server doesn't expose workers"
      end
    end

    def workers_relation
      MissionControl::Jobs::Current.server.workers_relation
    end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mission_control-jobs-1.0.1 app/controllers/mission_control/jobs/workers_controller.rb
mission_control-jobs-1.0.0 app/controllers/mission_control/jobs/workers_controller.rb
mission_control-jobs-0.6.0 app/controllers/mission_control/jobs/workers_controller.rb
mission_control-jobs-0.5.0 app/controllers/mission_control/jobs/workers_controller.rb
mission_control-jobs-0.4.0 app/controllers/mission_control/jobs/workers_controller.rb
mission_control-jobs-0.3.3 app/controllers/mission_control/jobs/workers_controller.rb
mission_control-jobs-0.3.2 app/controllers/mission_control/jobs/workers_controller.rb
mission_control-jobs-0.3.1 app/controllers/mission_control/jobs/workers_controller.rb
mission_control-jobs-0.3.0 app/controllers/mission_control/jobs/workers_controller.rb
mission_control-jobs-0.2.2 app/controllers/mission_control/jobs/workers_controller.rb
mission_control-jobs-0.2.1 app/controllers/mission_control/jobs/workers_controller.rb
mission_control-jobs-0.2.0 app/controllers/mission_control/jobs/workers_controller.rb