Sha256: 47f4e3cf1278da37b76e4d0db8bf6f6369f05c05d4370f914390e2846c508016

Contents?: true

Size: 1.84 KB

Versions: 13

Compression:

Stored size: 1.84 KB

Contents

<%@partial ||= partial -%>

<% @subtabs = resque.queues unless partial? %>

<% if queue = params[:id] %>

  <h1>Pending jobs on <span class='hl'><%= queue %></span></h1>
  <p class='sub'>Showing <%= start = params[:start].to_i %> to <%= start + 20 %> of <b><%=size = resque.size(queue)%></b> jobs</p>
  <table class='jobs'>
    <tr>
      <th>Class</th>
      <th>Args</th>
      <th>&nbsp;</th>
    </tr>
    <% for job in (jobs = resque.peek(queue, start, 20)) %>
      <tr>
        <td class='class'><%= job['class'] %></td>
        <td class='args'><%= job['args'].inspect.html_safe %></td>
        <td>
          <%= button_to "Remove", {:controller=>'resque', :action=> 'remove_job',:class => job['class'], :args => Resque.encode(job['args'])}, :class => 'clear-failed', :method => :post %>
            </td>
      </tr>
    <% end %>
    <% if jobs.empty? %>
      <tr>
        <td class='no-data' colspan='3'>There are no pending jobs in this queue</td>
      </tr>
    <% end %>
  </table>
  <%= render(:partial => 'next_more', :locals => {:start => start, :size => size}) %>
<% else %>

  <h1 class='wi'>Queues</h1>
  <p class='intro'>The list below contains all the registered queues with the number of jobs currently in the queue. Select a queue from above to view all jobs currently pending on the queue.</p>
  <table class='queues'>
    <tr>
      <th>Name</th>
      <th>Jobs</th>
    </tr>
    <% for queue in resque.queues.sort_by { |q| q.to_s } %>
      <tr>
        <td class='queue'><%= link_to(queue, {:action => "queues", :id => queue}, :class => 'queue') %></td>
        <td class='size'><%= resque.size queue %></td>
      </tr>
    <% end %>
    <tr class='failed'>
      <td class='queue failed'><%= link_to('failed', {:action => "cleaner"}, :class => 'queue') %></td>
      <td class='size'><%= Resque::Failure.count %></td>
    </tr>
  </table>

<% end %>

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
resque_ui-3.2.4 app/views/resque/_queues.html.erb
resque_ui-3.2.3 app/views/resque/_queues.html.erb
resque_ui-3.2.2 app/views/resque/_queues.html.erb
resque_ui-3.2.1 app/views/resque/_queues.html.erb
resque_ui-3.2.0 app/views/resque/_queues.html.erb
resque_ui-3.1.7 app/views/resque/_queues.html.erb
resque_ui-3.1.6 app/views/resque/_queues.html.erb
resque_ui-3.1.5 app/views/resque/_queues.html.erb
resque_ui-3.1.4 app/views/resque/_queues.html.erb
resque_ui-3.1.3 app/views/resque/_queues.html.erb
resque_ui-3.1.2 app/views/resque/_queues.html.erb
resque_ui-3.1.1 app/views/resque/_queues.html.erb
resque_ui-3.1.0 app/views/resque/_queues.html.erb