Files
danbooru/app/views/delayed_jobs/index.html.erb
evazion f7784d2340 jobs: update jobs dashboard to work with GoodJob.
Update the jobs dashboard at /delayed_jobs to work with GoodJob instead
of DelayedJob.
2022-01-02 21:21:04 -06:00

43 lines
1.3 KiB
Plaintext

<div id="c-delayed-jobs">
<div id="a-index">
<h1>Delayed Jobs</h1>
<%= table_for @jobs, class: "striped autofit" do |t| %>
<% t.column "Name" do |job| %>
<%= job.job_class.titleize.delete_suffix(" Job") %>
<% end %>
<% t.column "Details", td: { class: "col-expand" } do |job| %>
<%= job.serialized_params["arguments"] %>
<% end %>
<% t.column "Error", td: { class: "col-expand" } do |job| %>
<% if job.error.present? %>
<%= job.error %>
<% end %>
<% end %>
<% t.column "Attempts" do |job| %>
<%= job.executions_count %>
<% end %>
<% t.column :status %>
<% t.column "Created" do |job| %>
<%= time_ago_in_words_tagged(job.created_at) %>
<% end %>
<% t.column column: "control" do |job| %>
<% if GoodJobPolicy.new(CurrentUser.user, job).update? %>
<%= link_to "Run", run_delayed_job_path(job), method: :put, remote: true %> |
<%= link_to "Retry", retry_delayed_job_path(job), method: :put, remote: true %> |
<%= link_to "Cancel", cancel_delayed_job_path(job), method: :put, remote: true %> |
<%= link_to "Delete", delayed_job_path(job), method: :delete, remote: true %>
<% end %>
<% end %>
<% end %>
<%= numbered_paginator(@jobs) %>
</div>
</div>