Page MenuHomeGRNET

index.html.erb
No OneTemporary

File Metadata

Created
Wed, Nov 19, 12:39 AM

index.html.erb

<ul class="nav nav-tabs">
<% @job_categories.each_with_index do |pair, idx| %>
<% title, jobs = pair %>
<% active = title.downcase == @category.try(:to_s) %>
<li role="presentation" class="<%= 'active' if active %>"><a data-toggle="tab" href="#<%= title.downcase %>"><%= title %></a></li>
<% end %>
</ul>
<div class="tab-content">
<% @job_categories.each_with_index do |pair, idx| %>
<% title, jobs = pair %>
<% active = title.downcase == @category.try(:to_s) %>
<div role="tabpanel" class="tab-pane <%= 'active' if active %>" id="<%= title.downcase %>">
<table class="table table-striped">
<thead>
<tr>
<th>Id</th>
<th>Created at</th>
<th>Domain</th>
<th>Type</th>
<th>Args</th>
<th>Retries</th>
<th colspan="2">Controls</th>
</tr>
</thead>
<tbody>
<% jobs.each do |job| %>
<tr class="<%= 'danger' if job.failed? %>">
<td><%= job.id %></td>
<td><%= job.created_at %></td>
<% if job.domain %>
<td><%= link_to job.domain.name, domain_path(job.domain) %></td>
<% else %>
<td><%= job.arguments['zone'] %></td>
<% end %>
<td><%= job.job_type %></td>
<% if job.args.size > 70 %>
<td data-toggle="tooltip" data-placement="right" title="<%= job.args %>"><%= truncate(job.args, length: 70) %></td>
<% else %>
<td><%= job.args %></td>
<% end %>
<td><%= job.retries %></td>
<td>
<%= link_to('done', done_admin_job_path(job), method: :put) unless job.done? %>
<%= link_to('pending', pending_admin_job_path(job), method: :put) if job.failed? %>
</td>
<td><%= link_to_destroy admin_job_path(job), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<%= will_paginate jobs, params: { category: title.downcase } %>
</div>
<% end %>
</div>

Event Timeline