Class: SolidObserver::DashboardController

Inherits:
ApplicationController show all
Defined in:
app/controllers/solid_observer/dashboard_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

runtime_db_errors

Instance Method Details

#indexObject



12
13
14
15
16
17
18
19
# File 'app/controllers/solid_observer/dashboard_controller.rb', line 12

def index
  @component = selected_component

  return unless @component == "queue" && SolidObserver.config.solid_queue_enabled?

  assign_range_and_stats
  load_persistence_data if persistence_mode?
end

#live_pollObject



21
22
23
24
25
26
27
28
# File 'app/controllers/solid_observer/dashboard_controller.rb', line 21

def live_poll
  expires_in 1.day, public: true
  send_file(
    SolidObserver::Engine.root.join("app/assets/javascripts/solid_observer/live_poll.js"),
    type: "application/javascript; charset=utf-8",
    disposition: "inline"
  )
end

#poll_dataObject



30
31
32
33
34
35
# File 'app/controllers/solid_observer/dashboard_controller.rb', line 30

def poll_data
  range = QueueStats.parse_range(request_range_param, fallback: QueueStats::POLL_DEFAULT_RANGE)
  window = QueueStats.range_duration(range, fallback: QueueStats::POLL_DEFAULT_RANGE)
  append_chart_buffer
  render json: tick_request? ? tick_payload : full_payload(range: range, window: window)
end