lib/qless/server/views/_job.erb in qless-0.9.3 vs lib/qless/server/views/_job.erb in qless-0.10.0

- old
+ new

@@ -2,29 +2,32 @@ <div class="row" id="job-<%= job.jid %>"> <div class="span12"> <div class="row"> <div class="span6"> <h2 style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden"> - <a href="<%= u "/jobs/#{job.jid}" %>"><%= job.jid[0..8] %>...</a> | <%= job.klass_name %> + <a href="<%= u "/jobs/#{job.jid}" %>" title="<%= job.jid %>"><%= job.jid[0..8] %>...</a> | <span title="<%= job.klass_name %>"><%= job.klass_name %></span> </h2> </div> <div class="span3"> <h2 style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden"> <strong> - | <%= job.state %> / <a href="<%= u "/queues/#{job.queue_name}" %>"><%= job.queue_name %></a><%= job.worker_name.nil? ? "/ #{job.worker_name}" : "" %> + | <%= job.state %> / <a href="<%= u "/queues/#{CGI::escape(job.queue_name)}" %>" title="<%= job.queue_name %><%= job.worker_name.nil? ? "/ #{job.worker_name}" : "" %>"><%= job.queue_name %></a><%= job.worker_name.nil? ? "/ #{job.worker_name}" : "" %> </strong> </h2> </div> <div class="span3"> <div style="float:right; margin-top: 4px"> <div class="btn-group"> <% if (job.state != "complete") %> <button title="delete" class="btn btn-danger" onclick="confirmation(this, 'Delete?', function() { cancel('<%= job.jid %>', fade) })"><i class="icon-remove"></i></button> <% end %> + <% if (job.state == "running") %> + <button title="Time out job" class="btn btn-danger" onclick="confirmation(this, 'Time out job?', function() { timeout('<%= job.jid %>') })"><i class="icon-time"></i></button> + <% end %> <button title="track" class="btn<%= job.tracked ? " active" : "" %>" data-toggle="button" onclick="$(this).hasClass('active') ? untrack('<%= job.jid %>', fade) : track('<%= job.jid %>', [], fade)"><i class="icon-flag"></i></button> <% if (job.state == 'failed') %> - <button title="retry" class="btn btn-success" onclick="retry('<%= job.jid %>', fade)"><i class="icon-repeat"></i></button> + <button title="requeue" class="btn btn-success" onclick="retry('<%= job.jid %>', fade)"><i class="icon-repeat"></i></button> <% end %> <button title="move" class="btn dropdown-toggle btn-success" data-toggle="dropdown"> <i class="caret"></i> </button> <ul class="dropdown-menu"> @@ -54,11 +57,11 @@ <div class="row"> <div class="span12" style="margin-bottom: 10px"> <div style="float:left; margin-right: 10px"><h3>Dependencies:</h3></div> <% job.dependencies.each do |jid| %> <div class="btn-group" style="float:left; margin-right: 10px" id="<%= sanitize_attr("#{job.jid}-dependson-#{jid}") %>"> - <button class="btn" onclick="window.open('<%= u "/jobs/#{jid}" %>', '_blank')"><%= jid[0...8] %>...</button> + <button class="btn" onclick="window.open('<%= u "/jobs/#{jid}" %>', '_blank')" title="<%= jid %>"><%= jid[0...8] %>...</button> <button class="btn dropdown-toggle" onclick="confirmation(this, 'Undepend?', function() { undepend('<%= job.jid %>', '<%= jid %>', function() { $('#<%= sanitize_attr("#{job.jid}-dependson-#{jid}") %>').remove()} ); })"> <i class="icon-remove"></i> </button> </div> <% end %> @@ -70,11 +73,11 @@ <div class="row"> <div class="span12" style="margin-bottom: 10px"> <div style="float:left; margin-right: 10px"><h3>Dependents:</h3></div> <% job.dependents.each do |jid| %> <div class="btn-group" style="float:left; margin-right: 10px" id="<%= sanitize_attr("#{job.jid}-dependents-#{jid}") %>"> - <button class="btn" onclick="window.open('<%= u "/jobs/#{jid}" %>', '_blank')"><%= jid[0...8] %>...</button> + <button class="btn" onclick="window.open('<%= u "/jobs/#{jid}" %>', '_blank')" title="<%= jid %>"><%= jid[0...8] %>...</button> <button class="btn dropdown-toggle" onclick="confirmation(this, 'Undepend?', function() { undepend('<%= jid %>', '<%= job.jid %>', function() { $('#<%= sanitize_attr("#{job.jid}-dependents-#{jid}") %>').remove()} ); })"> <i class="icon-remove"></i> </button> </div> <% end %> @@ -90,11 +93,11 @@ <button class="btn" onclick="untag('<%= job.jid %>', '<%= tag %>')"> <i class="icon-remove"></i> </button> </div> <% end %> - + <!-- One for adding new tags --> <div class="btn-group" style="float:left"> <input class="span1 add-tag" type="text" placeholder="Add Tag" onchange="tag('<%= job.jid %>', $(this).val())"></input> <button class="btn" onclick="tag('<%= job.jid %>', $(this).parent().siblings().val())"> <i class="icon-plus"></i> @@ -111,16 +114,31 @@ </div> <div class="span6"> <h3><small>History</small></h3> <div style="overflow-y:scroll; height: 200px"> <% job.queue_history.reverse.each do |h| %> - <pre><strong><%= h['q'] %></strong> - Put: <%= strftime(h['put']) %><% if not h['popped'].nil? %> - Pop: <%= strftime(h['popped']) %> by <%= h['worker'] %><% end %><% if not h['completed'].nil? %> - Completed: <%= strftime(h['completed']) %><% end %><% if not h['failed'].nil? %> - Failed: <%= strftime(h['failed']) %><% end %></pre> + <% if h['what'] == 'put' %> + <pre><strong><%= h['what'] %></strong> at <%= strftime(h['when']) %> + in queue <strong><%= h['q'] %></strong></pre> + <% elsif h['what'] == 'popped' %> + <pre><strong><%= h['what'] %></strong> at <%= strftime(h['when']) %> + by <strong><%= h['worker'] %></strong></pre> + <% elsif h['what'] == 'done' %> + <pre><strong>completed</strong> at <%= strftime(h['when']) %></pre> + <% elsif h['what'] == 'failed' %> + <% if h['worker'] %> + <pre><strong><%= h['what'] %></strong> at <%= strftime(h['when']) %> + by <strong><%= h['worker'] %></strong> + in group <strong><%= h['group'] %></strong></pre> + <% else %> + <pre><strong><%= h['what'] %></strong> at <%= strftime(h['when']) %> + in group <strong><%= h['group'] %></strong></pre> + <% end %> + <% else %> + <pre><strong><%= h['what'] %></strong> at <%= strftime(h['when']) %></pre> <% end %> + <% end %> </div> </div> </div> <% end %> @@ -142,17 +160,17 @@ <div class="row" id="job-<%= job.jid %>"> <div class="span12"> <div class="row"> <div class="span6"> <h2 style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden"> - <a href="<%= u "/jobs/#{job.jid}" %>"><%= job.jid[0..8] %>...</a> | <%= job.klass_name %> + <a href="<%= u "/jobs/#{job.jid}" %>" title="<%= job.jid %>"><%= job.jid[0..8] %>...</a> | <span title="<%= job.klass_name %>"><%= job.klass_name %></span> </h2> </div> <div class="span3"> <h2 style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden"> <strong> - | recurring / <a href="<%= u "/queues/#{job.queue_name}" %>"><%= job.queue_name %></a> + | recurring / <a href="<%= u "/queues/#{CGI::escape(job.queue_name)}" %>" title="<%= job.queue_name %>"><%= job.queue_name %></a> </strong> </h2> </div> <div class="span3"> <div style="float:right; margin-top: 4px"> @@ -181,21 +199,21 @@ </ul> </div> </div> </div> </div> - + <div class="row"> <div class="span12 tags" style="margin-bottom: 3px;"> <% job.tags.each do |tag| %> <div class="btn-group" style="float:left"> <span class="tag"><%= tag %></span> <button class="btn" onclick="untag('<%= job.jid %>', '<%= tag %>')"> <i class="icon-remove"></i> </button> </div> <% end %> - + <!-- One for adding new tags --> <div class="btn-group" style="float:left"> <input class="span1 add-tag" type="text" placeholder="Add Tag" onchange="tag('<%= job.jid %>', $(this).val())"></input> <button class="btn" onclick="tag('<%= job.jid %>', $(this).parent().siblings().val())"> <i class="icon-plus"></i>