File: queue.erb

package info (click to toggle)
ruby-sidekiq 3.2.6~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,128 kB
  • ctags: 1,222
  • sloc: ruby: 5,848; makefile: 37; sh: 4
file content (42 lines) | stat: -rw-r--r-- 1,586 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<header class="row">
  <div class="col-sm-5">
    <h3>
      <%= t('CurrentMessagesInQueue', :queue => @name) %>
      <% if @queue.paused? %>
        <span class="label label-danger"><%= t('Paused') %></span>
      <% end %>
    </h3>
  </div>
  <div class="col-sm-4 pull-right">
    <%= erb :_paging, :locals => { :url => "#{root_path}queues/#{@name}" } %>
  </div>
</header>
<table class="queue table table-hover table-bordered table-striped">
  <thead>
    <th><%= t('Job') %></th>
    <th><%= t('Arguments') %></th>
    <th></th>
  </thead>
  <% @messages.each_with_index do |msg, index| %>
    <tr>
      <td><%= msg.display_class %></td>
      <td>
        <% a = msg.display_args.inspect %>
        <% if a.size > 100 %>
          <%= h(msg.display_args.inspect[0..100]) + "... " %>
          <button data-toggle="collapse" data-target="#worker_<%= index %>" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
          <div class="toggle" id="worker_<%= index %>" style="display: none;"><%= h(msg.display_args) %></div>
        <% else %>
          <%= h(msg.display_args) %>
        <% end %>
      </td>
      <td>
        <form action="<%= root_path %>queues/<%= @name %>/delete" method="post">
          <input name="key_val" value="<%= h Sidekiq.dump_json(msg.item) %>" type="hidden" />
          <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSure') %>" />
        </form>
      </td>
    </tr>
  <% end %>
</table>
<%= erb :_paging, :locals => { :url => "#{root_path}queues/#{@name}" } %>