lib/resque/server/views/failed.erb in resque-1.0.0 vs lib/resque/server/views/failed.erb in resque-1.1.0

- old
+ new

@@ -1,29 +1,35 @@ -<h1><%= size = Resque::Failure.count %> Jobs Failed</h1> -<h2>Showing <%= start = params[:start].to_i %> to <%= start + 20 %></h2> -<table> - <tr> - <th>Queue</th> - <th>Worker</th> - <th>Failed</th> - <th>Class</th> - <th>Args</th> - <th>Error</th> - </tr> - <% for job in Resque::Failure.all(start, 20) %> - <tr> - <td><%= job['queue'] %></td> - <td><a href="<= url(:workers, job['worker']) %>"><%= job['worker'].split(':')[0...2].join(':') %></a></td> - <td><span class="time"><%= job['failed_at'] %></span></td> - <td><%= job['payload']['class'] %></td> - <td> - <a href="#" class="backtrace"><%= Array(job['payload']['args']).size %></a> - <pre style="display:none;"><%=h show_args(job['payload']['args']) %></pre> - </td> - <td> - <a href="#" class="backtrace"><%= h(job['error']) %></a> - <pre style="display:none;"><%=h job['backtrace'].join("\n") %></pre> - </td> - </tr> - <% end %> - <%= partial :next_more, :start => start, :size => size %> -</table> +<%start = params[:start].to_i %> +<%failed = Resque::Failure.all(start, 20)%> + +<h1>Failed Jobs</h1> +<%unless failed.empty?%> +<form method="POST" action="<%=u 'failed/clear'%>" class='clear-failed'> + <input type='submit' name='' value='Clear Failed Jobs' /> +</form> +<%end%> + +<p class='sub'>Showing <%=start%> to <%= start + 20 %> of <b><%= size = Resque::Failure.count %></b> jobs</p> + +<ul class='failed'> + <%for job in failed%> + <li> + <dl> + <dt>Worker</dt> + <dd><a href="<%= url(:workers, job['worker']) %>"><%= job['worker'].split(':')[0...2].join(':') %></a> on <b class='queue-tag'><%= job['queue'] %></b > at <b><span class="time"><%= job['failed_at'] %></span></b></dd> + <dt>Class</dt> + <dd><code><%= job['payload']['class'] %></code></dd> + <dt>Arguments</dt> + <dd><pre><%=h show_args(job['payload']['args']) %></pre></dd> + <dt>Error</dt> + <dd class='error'> + <a href="#" class="backtrace"><%= h(job['error']) %></a> + <pre style='display:none'><%=h job['backtrace'].join("\n") %></pre> + </dd> + </dl> + <div class='r'> + </div> + </li> + <%end%> +</ul> + +<%= partial :next_more, :start => start, :size => size %>