1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Create table containers with overflow is overlay

This commit is contained in:
Anton Davydov 2015-05-14 02:48:17 +03:00
parent 19ef4722e1
commit 17ee70f063
10 changed files with 353 additions and 327 deletions

View file

@ -165,6 +165,10 @@ header.row .pagination {
width: 100%;
}
.table_container {
overflow: overlay;
}
table.table-white {
background-color: #fff;
}

View file

@ -2,81 +2,83 @@
<h3><%= t('Job') %></h3>
</header>
<table class="table table-bordered table-striped">
<tbody>
<tr>
<th><%= t('Queue') %></th>
<td>
<a href="<%= root_path %>queues/<%= job.queue %>"><%= job.queue %></a>
</td>
</tr>
<tr>
<th><%= t('Job') %></th>
<td>
<code><%= job.display_class %></code>
</td>
</tr>
<tr>
<th><%= t('Arguments') %></th>
<td>
<code class="code-wrap">
<!-- We don't want to truncate any job arguments when viewing a single job's status page -->
<div class="args-extended"><%= display_args(job.display_args, nil) %></div>
</code>
</td>
</tr>
<tr>
<th>JID</th>
<td>
<code><%= job.jid %></code>
</td>
</tr>
<tr>
<th><%= t('Enqueued') %></th>
<td><%= relative_time(job.enqueued_at) %></td>
</tr>
<% unless retry_extra_items(job).empty? %>
<div class="table_container">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<th><%= t('Extras') %></th>
<th><%= t('Queue') %></th>
<td>
<code>
<%= retry_extra_items(job).inspect %>
<a href="<%= root_path %>queues/<%= job.queue %>"><%= job.queue %></a>
</td>
</tr>
<tr>
<th><%= t('Job') %></th>
<td>
<code><%= job.display_class %></code>
</td>
</tr>
<tr>
<th><%= t('Arguments') %></th>
<td>
<code class="code-wrap">
<!-- We don't want to truncate any job arguments when viewing a single job's status page -->
<div class="args-extended"><%= display_args(job.display_args, nil) %></div>
</code>
</td>
</tr>
<% end %>
<% if type == :retry %>
<% if job['retry_count'] && job['retry_count'] > 0 %>
<tr>
<th>JID</th>
<td>
<code><%= job.jid %></code>
</td>
</tr>
<tr>
<th><%= t('Enqueued') %></th>
<td><%= relative_time(job.enqueued_at) %></td>
</tr>
<% unless retry_extra_items(job).empty? %>
<tr>
<th><%= t('RetryCount') %></th>
<td><%= job['retry_count'] %></td>
</tr>
<tr>
<th><%= t('LastRetry') %></th>
<td><%= relative_time(Time.at(job['retried_at'])) %></td>
</tr>
<% else %>
<tr>
<th><%= t('OriginallyFailed') %></th>
<td><%= relative_time(Time.at(job['failed_at'])) %></td>
<th><%= t('Extras') %></th>
<td>
<code>
<%= retry_extra_items(job).inspect %>
</code>
</td>
</tr>
<% end %>
<tr>
<th><%= t('NextRetry') %></th>
<td><%= relative_time(job.at) %></td>
</tr>
<% end %>
<% if type == :scheduled %>
<tr>
<th><%= t('Scheduled') %></th>
<td><%= relative_time(job.at) %></td>
</tr>
<% end %>
<% if type == :dead %>
<tr>
<th><%= t('LastRetry') %></th>
<td><%= relative_time(job.at) %></td>
</tr>
<% end %>
</tbody>
</table>
<% if type == :retry %>
<% if job['retry_count'] && job['retry_count'] > 0 %>
<tr>
<th><%= t('RetryCount') %></th>
<td><%= job['retry_count'] %></td>
</tr>
<tr>
<th><%= t('LastRetry') %></th>
<td><%= relative_time(Time.at(job['retried_at'])) %></td>
</tr>
<% else %>
<tr>
<th><%= t('OriginallyFailed') %></th>
<td><%= relative_time(Time.at(job['failed_at'])) %></td>
</tr>
<% end %>
<tr>
<th><%= t('NextRetry') %></th>
<td><%= relative_time(job.at) %></td>
</tr>
<% end %>
<% if type == :scheduled %>
<tr>
<th><%= t('Scheduled') %></th>
<td><%= relative_time(job.at) %></td>
</tr>
<% end %>
<% if type == :dead %>
<tr>
<th><%= t('LastRetry') %></th>
<td><%= relative_time(job.at) %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

View file

@ -13,41 +13,43 @@
</div>
</div>
<table class="processes table table-hover table-bordered table-striped table-white">
<thead>
<th><%= t('Name') %></th>
<th><%= t('Started') %></th>
<th><%= t('Threads') %></th>
<th><%= t('Busy') %></th>
<th>&nbsp;</th>
</thead>
<% processes.each do |process| %>
<tr>
<td width="50%">
<%= "#{process['hostname']}:#{process['pid']}" %>
<span class="label label-success"><%= process.tag %></span>
<% process.labels.each do |label| %>
<span class="label label-info"><%= label %></span>
<% end %>
<br>
<b><%= "#{t('Queues')}: " %></b>
<%= process['queues'] * ", " %>
</td>
<td><%= relative_time(Time.at(process['started_at'])) %></td>
<td><%= process['concurrency'] %></td>
<td><%= process['busy'] %></td>
<td>
<div class="btn-group pull-right">
<form method="POST">
<input type="hidden" name="identity" value="<%= process['identity'] %>"/>
<button class="btn btn-warn" type="submit" name="quiet" value="1"><%= t('Quiet') %></button>
<button class="btn btn-danger" type="submit" name="stop" value="1"><%= t('Stop') %></button>
</form>
</div>
</td>
</tr>
<% end %>
</table>
<div class="table_container">
<table class="processes table table-hover table-bordered table-striped table-white">
<thead>
<th><%= t('Name') %></th>
<th><%= t('Started') %></th>
<th><%= t('Threads') %></th>
<th><%= t('Busy') %></th>
<th>&nbsp;</th>
</thead>
<% processes.each do |process| %>
<tr>
<td width="50%">
<%= "#{process['hostname']}:#{process['pid']}" %>
<span class="label label-success"><%= process.tag %></span>
<% process.labels.each do |label| %>
<span class="label label-info"><%= label %></span>
<% end %>
<br>
<b><%= "#{t('Queues')}: " %></b>
<%= process['queues'] * ", " %>
</td>
<td><%= relative_time(Time.at(process['started_at'])) %></td>
<td><%= process['concurrency'] %></td>
<td><%= process['busy'] %></td>
<td>
<div class="btn-group pull-right">
<form method="POST">
<input type="hidden" name="identity" value="<%= process['identity'] %>"/>
<button class="btn btn-warn" type="submit" name="quiet" value="1"><%= t('Quiet') %></button>
<button class="btn btn-danger" type="submit" name="stop" value="1"><%= t('Stop') %></button>
</form>
</div>
</td>
</tr>
<% end %>
</table>
</div>
<div class="row header">
<div class="col-sm-7">
@ -55,30 +57,32 @@
</div>
</div>
<table class="workers table table-hover table-bordered table-striped table-white">
<thead>
<th><%= t('Process') %></th>
<th><%= t('TID') %></th>
<th><%= t('JID') %></th>
<th><%= t('Queue') %></th>
<th><%= t('Job') %></th>
<th><%= t('Arguments') %></th>
<th><%= t('Started') %></th>
</thead>
<% workers.each do |process, thread, msg| %>
<% job = Sidekiq::Job.new(msg['payload']) %>
<tr>
<td><%= process %></td>
<td><%= thread %></td>
<td><%= job.jid %></td>
<td>
<a href="<%= root_path %>queues/<%= msg['queue'] %>"><%= msg['queue'] %></a>
</td>
<td><%= job.display_class %></td>
<td>
<div class="args"><%= display_args(job.display_args) %></div>
</td>
<td><%= relative_time(Time.at(msg['run_at'])) %></td>
</tr>
<% end %>
</table>
<div class="table_container">
<table class="workers table table-hover table-bordered table-striped table-white">
<thead>
<th><%= t('Process') %></th>
<th><%= t('TID') %></th>
<th><%= t('JID') %></th>
<th><%= t('Queue') %></th>
<th><%= t('Job') %></th>
<th><%= t('Arguments') %></th>
<th><%= t('Started') %></th>
</thead>
<% workers.each do |process, thread, msg| %>
<% job = Sidekiq::Job.new(msg['payload']) %>
<tr>
<td><%= process %></td>
<td><%= thread %></td>
<td><%= job.jid %></td>
<td>
<a href="<%= root_path %>queues/<%= msg['queue'] %>"><%= msg['queue'] %></a>
</td>
<td><%= job.display_class %></td>
<td>
<div class="args"><%= display_args(job.display_args) %></div>
</td>
<td><%= relative_time(Time.at(msg['run_at'])) %></td>
</tr>
<% end %>
</table>
</div>

View file

@ -1,28 +1,31 @@
<%= erb :_job_info, :locals => {:job => @dead, :type => :dead} %>
<h3><%= t('Error') %></h3>
<table class="error table table-bordered table-striped">
<tbody>
<tr>
<th><%= t('ErrorClass') %></th>
<td>
<code><%= @dead['error_class'] %></code>
</td>
</tr>
<tr>
<th><%= t('ErrorMessage') %></th>
<td><%= h(@dead['error_message']) %></td>
</tr>
<% if !@dead['error_backtrace'].nil? %>
<div class="table_container">
<table class="error table table-bordered table-striped">
<tbody>
<tr>
<th><%= t('ErrorBacktrace') %></th>
<th><%= t('ErrorClass') %></th>
<td>
<code><%= @dead['error_backtrace'].join("<br/>") %></code>
<code><%= @dead['error_class'] %></code>
</td>
</tr>
<% end %>
</tbody>
</table>
<tr>
<th><%= t('ErrorMessage') %></th>
<td><%= h(@dead['error_message']) %></td>
</tr>
<% if !@dead['error_backtrace'].nil? %>
<tr>
<th><%= t('ErrorBacktrace') %></th>
<td>
<code><%= @dead['error_backtrace'].join("<br/>") %></code>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<form class="form-horizontal" action="<%= root_path %>morgue/<%= job_params(@dead, @dead.score) %>" method="post">
<a class="btn btn-default" href="<%= root_path %>morgue"><%= t('GoBack') %></a>
<input class="btn btn-primary" type="submit" name="retry" value="<%= t('RetryNow') %>" />

View file

@ -12,44 +12,46 @@
<% if @dead.size > 0 %>
<form action="<%= root_path %>morgue" method="post">
<table class="table table-striped table-bordered table-white">
<thead>
<tr>
<th width="20px" class="table-checkbox">
<label>
<input type="checkbox" class="check_all" />
</label>
</th>
<th><%= t('LastRetry') %></th>
<th><%= t('Queue') %></th>
<th><%= t('Job') %></th>
<th><%= t('Arguments') %></th>
<th><%= t('Error') %></th>
</tr>
</thead>
<% @dead.each do |entry| %>
<tr>
<td class="table-checkbox">
<label>
<input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
</label>
</td>
<td>
<a href="<%= root_path %>morgue/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
</td>
<td>
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
</td>
<td><%= entry.display_class %></td>
<td>
<div class="args"><%= display_args(entry.display_args) %></div>
</td>
<td>
<div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
</td>
</tr>
<% end %>
</table>
<div class="table_container">
<table class="table table-striped table-bordered table-white">
<thead>
<tr>
<th width="20px" class="table-checkbox">
<label>
<input type="checkbox" class="check_all" />
</label>
</th>
<th><%= t('LastRetry') %></th>
<th><%= t('Queue') %></th>
<th><%= t('Job') %></th>
<th><%= t('Arguments') %></th>
<th><%= t('Error') %></th>
</tr>
</thead>
<% @dead.each do |entry| %>
<tr>
<td class="table-checkbox">
<label>
<input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
</label>
</td>
<td>
<a href="<%= root_path %>morgue/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
</td>
<td>
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
</td>
<td><%= entry.display_class %></td>
<td>
<div class="args"><%= display_args(entry.display_args) %></div>
</td>
<td>
<div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
</td>
</tr>
<% end %>
</table>
</div>
<input class="btn btn-primary btn-xs pull-left" type="submit" name="retry" value="<%= t('RetryNow') %>" />
<input class="btn btn-danger btn-xs pull-left" type="submit" name="delete" value="<%= t('Delete') %>" />
</form>

View file

@ -11,32 +11,34 @@
<%= 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><%= h(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>
<div class="table_container">
<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><%= h(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>
</div>
<%= erb :_paging, :locals => { :url => "#{root_path}queues/#{@name}" } %>

View file

@ -1,25 +1,27 @@
<h3><%= t('Queues') %></h3>
<table class="queues table table-hover table-bordered table-striped table-white">
<thead>
<th><%= t('Queue') %></th>
<th><%= t('Size') %></th>
<th><%= t('Actions') %></th>
</thead>
<% @queues.each do |queue| %>
<tr>
<td>
<a href="<%= root_path %>queues/<%= queue.name %>"><%= queue.name %></a>
<% if queue.paused? %>
<span class="label label-danger"><%= t('Paused') %></span>
<% end %>
</td>
<td><%= number_with_delimiter(queue.size) %> </td>
<td width="20%">
<form action="<%=root_path %>queues/<%= queue.name %>" method="post">
<input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.name)) %>" />
</form>
</td>
</tr>
<% end %>
</table>
<div class="table_container">
<table class="queues table table-hover table-bordered table-striped table-white">
<thead>
<th><%= t('Queue') %></th>
<th><%= t('Size') %></th>
<th><%= t('Actions') %></th>
</thead>
<% @queues.each do |queue| %>
<tr>
<td>
<a href="<%= root_path %>queues/<%= queue.name %>"><%= queue.name %></a>
<% if queue.paused? %>
<span class="label label-danger"><%= t('Paused') %></span>
<% end %>
</td>
<td><%= number_with_delimiter(queue.size) %> </td>
<td width="20%">
<form action="<%=root_path %>queues/<%= queue.name %>" method="post">
<input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.name)) %>" />
</form>
</td>
</tr>
<% end %>
</table>
</div>

View file

@ -12,46 +12,48 @@
<% if @retries.size > 0 %>
<form action="<%= root_path %>retries" method="post">
<table class="table table-striped table-bordered table-white">
<thead>
<tr>
<th width="20px" class="table-checkbox">
<label>
<input type="checkbox" class="check_all" />
</label>
</th>
<th><%= t('NextRetry') %></th>
<th><%= t('RetryCount') %></th>
<th><%= t('Queue') %></th>
<th><%= t('Job') %></th>
<th><%= t('Arguments') %></th>
<th><%= t('Error') %></th>
</tr>
</thead>
<% @retries.each do |entry| %>
<tr>
<td class="table-checkbox">
<label>
<input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
</label>
</td>
<td>
<a href="<%= root_path %>retries/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
</td>
<td><%= entry['retry_count'] %></td>
<td>
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
</td>
<td><%= entry.display_class %></td>
<td>
<div class="args"><%= display_args(entry.display_args) %></div>
</td>
<td>
<div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
</td>
</tr>
<% end %>
</table>
<div class="table_container">
<table class="table table-striped table-bordered table-white">
<thead>
<tr>
<th width="20px" class="table-checkbox">
<label>
<input type="checkbox" class="check_all" />
</label>
</th>
<th><%= t('NextRetry') %></th>
<th><%= t('RetryCount') %></th>
<th><%= t('Queue') %></th>
<th><%= t('Job') %></th>
<th><%= t('Arguments') %></th>
<th><%= t('Error') %></th>
</tr>
</thead>
<% @retries.each do |entry| %>
<tr>
<td class="table-checkbox">
<label>
<input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
</label>
</td>
<td>
<a href="<%= root_path %>retries/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
</td>
<td><%= entry['retry_count'] %></td>
<td>
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
</td>
<td><%= entry.display_class %></td>
<td>
<div class="args"><%= display_args(entry.display_args) %></div>
</td>
<td>
<div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
</td>
</tr>
<% end %>
</table>
</div>
<input class="btn btn-primary btn-xs pull-left" type="submit" name="retry" value="<%= t('RetryNow') %>" />
<input class="btn btn-danger btn-xs pull-left" type="submit" name="delete" value="<%= t('Delete') %>" />
<input class="btn btn-danger btn-xs pull-left" type="submit" name="kill" value="<%= t('Kill') %>" />

View file

@ -1,28 +1,31 @@
<%= erb :_job_info, :locals => {:job => @retry, :type => :retry} %>
<h3><%= t('Error') %></h3>
<table class="error table table-bordered table-striped">
<tbody>
<tr>
<th><%= t('ErrorClass') %></th>
<td>
<code><%= @retry['error_class'] %></code>
</td>
</tr>
<tr>
<th><%= t('ErrorMessage') %></th>
<td><%= h(@retry['error_message']) %></td>
</tr>
<% if !@retry['error_backtrace'].nil? %>
<div class="table_container">
<table class="error table table-bordered table-striped">
<tbody>
<tr>
<th><%= t('ErrorBacktrace') %></th>
<th><%= t('ErrorClass') %></th>
<td>
<code><%= @retry['error_backtrace'].join("<br/>") %></code>
<code><%= @retry['error_class'] %></code>
</td>
</tr>
<% end %>
</tbody>
</table>
<tr>
<th><%= t('ErrorMessage') %></th>
<td><%= h(@retry['error_message']) %></td>
</tr>
<% if !@retry['error_backtrace'].nil? %>
<tr>
<th><%= t('ErrorBacktrace') %></th>
<td>
<code><%= @retry['error_backtrace'].join("<br/>") %></code>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<form class="form-horizontal" action="<%= root_path %>retries/<%= job_params(@retry, @retry.score) %>" method="post">
<a class="btn btn-default" href="<%= root_path %>retries"><%= t('GoBack') %></a>
<input class="btn btn-primary" type="submit" name="retry" value="<%= t('RetryNow') %>" />

View file

@ -13,36 +13,38 @@
<% if @scheduled.size > 0 %>
<form action="<%= root_path %>scheduled" method="post">
<table class="table table-striped table-bordered table-white">
<thead>
<tr>
<th width="20px">
<input type="checkbox" class="check_all" />
</th>
<th><%= t('When') %></th>
<th><%= t('Queue') %></th>
<th><%= t('Job') %></th>
<th><%= t('Arguments') %></th>
</tr>
</thead>
<% @scheduled.each do |entry| %>
<tr>
<td>
<input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
</td>
<td>
<a href="<%= root_path %>scheduled/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
</td>
<td>
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
</td>
<td><%= entry.display_class %></td>
<td>
<div class="args"><%= display_args(entry.display_args) %></div>
</td>
</tr>
<% end %>
</table>
<div class="table_container">
<table class="table table-striped table-bordered table-white">
<thead>
<tr>
<th width="20px">
<input type="checkbox" class="check_all" />
</th>
<th><%= t('When') %></th>
<th><%= t('Queue') %></th>
<th><%= t('Job') %></th>
<th><%= t('Arguments') %></th>
</tr>
</thead>
<% @scheduled.each do |entry| %>
<tr>
<td>
<input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
</td>
<td>
<a href="<%= root_path %>scheduled/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
</td>
<td>
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
</td>
<td><%= entry.display_class %></td>
<td>
<div class="args"><%= display_args(entry.display_args) %></div>
</td>
</tr>
<% end %>
</table>
</div>
<input class="btn btn-danger pull-right" type="submit" name="delete" value="<%= t('Delete') %>" />
<input class="btn btn-danger pull-right" type="submit" name="add_to_queue" value="<%= t('AddToQueue') %>" />
</form>