Class: SolidQueueTui::Components::JobTable
- Inherits:
-
Object
- Object
- SolidQueueTui::Components::JobTable
- Defined in:
- lib/solid_queue_tui/components/job_table.rb
Constant Summary collapse
- STATUS_COLORS =
{ "ready" => :green, "claimed" => :yellow, "scheduled" => :blue, "failed" => :red, "blocked" => :magenta, "completed" => :dark_gray, "active" => :green, "paused" => :red, "unknown" => :white }.freeze
Instance Method Summary collapse
-
#initialize(tui, title:, columns:, rows:, selected_row: nil, empty_message: "No data") ⇒ JobTable
constructor
A new instance of JobTable.
- #render(frame, area, table_state) ⇒ Object
Constructor Details
#initialize(tui, title:, columns:, rows:, selected_row: nil, empty_message: "No data") ⇒ JobTable
Returns a new instance of JobTable.
18 19 20 21 22 23 24 25 |
# File 'lib/solid_queue_tui/components/job_table.rb', line 18 def initialize(tui, title:, columns:, rows:, selected_row: nil, empty_message: "No data") @tui = tui @title = title @columns = columns @rows = rows @selected_row = selected_row @empty_message = end |
Instance Method Details
#render(frame, area, table_state) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/solid_queue_tui/components/job_table.rb', line 27 def render(frame, area, table_state) if @rows.empty? render_empty(frame, area) return end render_table(frame, area, table_state) end |