Sha256: 2473e3469422b645b43905671f08c49b6f60d80a28169df7d87cfc6bcb94faa0

Contents?: true

Size: 1.31 KB

Versions: 5

Compression:

Stored size: 1.31 KB

Contents

module RocketJobMissionControl
  module DirmonEntries
    class IndexFiltersController < RocketJobMissionControl::ApplicationController
      before_filter :load_dirmon_entries
      before_filter :show_sidebar

      def pending
        @dirmons = @dirmons.where(state: :pending)
        respond_to do |format|
          format.html
          format.json { render(json: DirmonEntriesDatatable.new(view_context, @dirmons)) }
        end
      end

      def enabled
        @dirmons = @dirmons.where(state: :enabled)
        respond_to do |format|
          format.html
          format.json { render(json: DirmonEntriesDatatable.new(view_context, @dirmons)) }
        end
      end

      def failed
        @dirmons = @dirmons.where(state: :failed)
        respond_to do |format|
          format.html
          format.json { render(json: DirmonEntriesDatatable.new(view_context, @dirmons)) }
        end
      end

      def disabled
        @dirmons = @dirmons.where(state: :disabled)
        respond_to do |format|
          format.html
          format.json { render(json: DirmonEntriesDatatable.new(view_context, @dirmons)) }
        end
      end

      private

      def load_dirmon_entries
        @dirmons = RocketJob::DirmonEntry.where()
      end

      def show_sidebar
        @dirmon_sidebar = true
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rocketjob_mission_control-2.1.1 app/controllers/rocket_job_mission_control/dirmon_entries/index_filters_controller.rb
rocketjob_mission_control-2.1.0 app/controllers/rocket_job_mission_control/dirmon_entries/index_filters_controller.rb
rocketjob_mission_control-2.0.0 app/controllers/rocket_job_mission_control/dirmon_entries/index_filters_controller.rb
rocketjob_mission_control-2.0.0.rc2 app/controllers/rocket_job_mission_control/dirmon_entries/index_filters_controller.rb
rocketjob_mission_control-2.0.0.rc1 app/controllers/rocket_job_mission_control/dirmon_entries/index_filters_controller.rb