File: queue.erb

package info (click to toggle)
ruby-sidekiq 6.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 792 kB
  • sloc: ruby: 4,582; makefile: 20; sh: 6
file content (55 lines) | stat: -rw-r--r-- 2,233 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
43
44
45
46
47
48
49
50
51
52
53
54
55
<header class="row">
  <div class="col-sm-5">
    <h3>
      <%= t('CurrentMessagesInQueue', :queue => h(@name)) %>
      <% if @queue.paused? %>
        <span class="label label-danger"><%= t('Paused') %></span>
      <% end %>
      <span class="badge badge-secondary"><%= number_with_delimiter(@total_size) %></span>
    </h3>
  </div>
  <div class="col-sm-4 pull-right flip">
    <%= erb :_paging, locals: { url: "#{root_path}queues/#{CGI.escape(@name)}" } %>
  </div>
</header>
<div class="table_container">
  <table class="queue table table-hover table-bordered table-striped">
    <thead>
      <th><a href="<%= url %>?direction=<%= params[:direction] == 'asc' ? 'desc' : 'asc' %>"># <%= sort_direction_label %></a></th>
      <th><%= t('Job') %></th>
      <th><%= t('Arguments') %></th>
      <th></th>
    </thead>
    <% @jobs.each_with_index do |job, index| %>
      <tr title="<%= job.jid %>">
        <% if params[:direction] == 'asc' %>
          <td><%= @count * (@current_page - 1) + index + 1 %></td>
        <% else %>
          <td><%= @total_size - (@count * (@current_page - 1) + index) %></td>
        <% end %>
        <td>
          <%= h(job.display_class) %>
          <%= display_tags(job, nil) %>
        </td>
        <td>
          <% a = job.display_args %>
          <% if a.inspect.size > 100 %>
            <span id="job_<%= index %>"><%= h(a.inspect[0..100]) + "... " %></span>
            <button data-toggle="job_<%= index %>" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
            <div class="toggle" id="job_<%= index %>_full"><%= display_args(a) %></div>
          <% else %>
            <%= display_args(job.display_args) %>
          <% end %>
        </td>
        <td>
          <form action="<%= root_path %>queues/<%= CGI.escape(@name) %>/delete" method="post">
            <%= csrf_tag %>
            <input name="key_val" value="<%= h job.value %>" 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>
</div>
<%= erb :_paging, locals: { url: "#{root_path}queues/#{CGI.escape(@name)}" } %>