Sha256: 8585885bd79bdcb869e8c2289040c10fea68473895a5182690ae37cd080ca44f

Contents?: true

Size: 690 Bytes

Versions: 9

Compression:

Stored size: 690 Bytes

Contents

module RocketJobMissionControl
  class DirmonEntriesDatatable < AbstractDatatable
    delegate :dirmon_entry_path, :state_icon, to: :@view

    private

    def map(dirmon)
      {
        "0"           => name_with_link(dirmon),
        "1"           => h(dirmon.job_class_name),
        "2"           => h(dirmon.pattern.try(:truncate, 80)),
        "DT_RowClass" => "card callout callout-#{dirmon.state}"
      }
    end

    def name_with_link(dirmon)
      <<-EOS
        <a href="#{dirmon_entry_path(dirmon.id)}">
          <i class="#{state_icon(dirmon.state)}" style="font-size: 75%" title="#{dirmon.state}"></i>
          #{h(dirmon.name)}
        </a>
      EOS
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rocketjob_mission_control-6.1.0 app/datatables/rocket_job_mission_control/dirmon_entries_datatable.rb
rocketjob_mission_control-6.0.7 app/datatables/rocket_job_mission_control/dirmon_entries_datatable.rb
rocketjob_mission_control-6.0.6 app/datatables/rocket_job_mission_control/dirmon_entries_datatable.rb
rocketjob_mission_control-6.0.5 app/datatables/rocket_job_mission_control/dirmon_entries_datatable.rb
rocketjob_mission_control-6.0.4 app/datatables/rocket_job_mission_control/dirmon_entries_datatable.rb
rocketjob_mission_control-6.0.3 app/datatables/rocket_job_mission_control/dirmon_entries_datatable.rb
rocketjob_mission_control-6.0.2 app/datatables/rocket_job_mission_control/dirmon_entries_datatable.rb
rocketjob_mission_control-6.0.1 app/datatables/rocket_job_mission_control/dirmon_entries_datatable.rb
rocketjob_mission_control-6.0.0 app/datatables/rocket_job_mission_control/dirmon_entries_datatable.rb