Sha256: 876dda04fc2055c9d14af93516491165c39088bd5861fabe30ca64a31e7afcdc

Contents?: true

Size: 935 Bytes

Versions: 18

Compression:

Stored size: 935 Bytes

Contents

module Naf
  class MachineRunnersController < Naf::ApplicationController

    before_filter :set_rows_per_page

    def index
      respond_to do |format|
        format.html
        format.json do
          set_page

          @total_records = ::Naf::MachineRunner.count(:all)
          @rows = ::Logical::Naf::MachineRunner.to_array(params['iSortCol_0'].to_i, params['sSortDir_0']).
            paginate(page: @page, per_page: @rows_per_page)

          render layout: 'naf/layouts/jquery_datatables'
        end
      end
    end

    def show
      @machine_runner = Naf::MachineRunner.find(params[:id])
    end

    def runner_count
      running = ::Naf::MachineRunner.running.uniq.count
      winding_down = ::Naf::MachineRunner.winding_down.uniq.count
      down = ::Naf::MachineRunner.dead_count

      render json: {
        running: running,
        winding_down: winding_down,
        down: down
      }
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
naf-2.1.13 app/controllers/naf/machine_runners_controller.rb
naf-2.1.12 app/controllers/naf/machine_runners_controller.rb
naf-2.1.11 app/controllers/naf/machine_runners_controller.rb
naf-2.1.10 app/controllers/naf/machine_runners_controller.rb
naf-2.1.9 app/controllers/naf/machine_runners_controller.rb
naf-2.1.8 app/controllers/naf/machine_runners_controller.rb
naf-2.1.6 app/controllers/naf/machine_runners_controller.rb
naf-2.1.5 app/controllers/naf/machine_runners_controller.rb
naf-2.1.4 app/controllers/naf/machine_runners_controller.rb
naf-2.1.3 app/controllers/naf/machine_runners_controller.rb
naf-2.1.2 app/controllers/naf/machine_runners_controller.rb
naf-2.1.1 app/controllers/naf/machine_runners_controller.rb
naf-2.1.0 app/controllers/naf/machine_runners_controller.rb
naf-2.0.4 app/controllers/naf/machine_runners_controller.rb
naf-2.0.3 app/controllers/naf/machine_runners_controller.rb
naf-2.0.2 app/controllers/naf/machine_runners_controller.rb
naf-2.0.1 app/controllers/naf/machine_runners_controller.rb
naf-2.0.0 app/controllers/naf/machine_runners_controller.rb