Sha256: eedda219fa51818dab6639a116d705d282823d8d1a01ef2b9693f0624aa613d8

Contents?: true

Size: 1.58 KB

Versions: 2

Compression:

Stored size: 1.58 KB

Contents

<p>Delayed::Job.count: <%= Delayed::Job.count %></p>

<table id="jobs">
  <thead>
    <tr>
      <th>priority</th>
      <th>attempts</th>
      <th>handler</th>
      <th>last_error</th>
      <th>run_at</th>
      <th>locked_at</th>
      <th>failed_at</th>
      <th>locked_by</th>
      <th>created_at</th>
      <th>updated_at</th>
    </tr>
  </thead>
  <tbody>
    <% Delayed::Job.all.reverse.each do |job| %>
      <tr class="job" id="job-<%= job.id %>">
        <td><%= job.priority %></td>
        <td><%= job.attempts %></td>
        <td><%= truncate(job.handler || 'nil', :length => 50).gsub('---', '') %></td>
        <td><%= truncate(job.last_error || 'nil', :length => 50) %></td>
        <td><%= job.run_at.present? ? job.run_at.to_s(:short) : '-' %></td>
        <td><%= job.locked_at.present? ? job.locked_at.to_s(:short) : '-' %></td>
        <td><%= job.failed_at.present? ? job.failed_at.to_s(:short) : '-' %></td>
        <td><%= job.locked_by || '-' %></td>
        <td><%= job.created_at.to_s(:short) %></td>
        <td><%= job.updated_at.to_s(:short) %></td>
      </tr>
      <tr class="job-details" id="job-details-<%= job.id %>">
        <td colspan="10"><p><pre><%= job.to_yaml %></pre></p></td>
      </tr>
    <% end %>
  </tbody>
</table>

<script>
  $(document).ready(function(){

    $(".job").hover(
      function () {
        $(this).css("cursor", "pointer");
        $(this).addClass("hover");
      },
      function () {
        $(this).removeClass("hover");
      }
    );

    $(".job").click(function(event){
      $(this).next("tr").toggle();
    });

  });
</script>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
delayed_job_admin-1.0.0 app/views/delayed_job_admin/index.html.erb
delayed_job_admin-0.0.1 app/views/delayed_job_admin/index.html.erb