fixes #1096
This commit is contained in:
@@ -1,29 +1,60 @@
|
|||||||
module DelayedJobsHelper
|
module DelayedJobsHelper
|
||||||
|
def print_name(job)
|
||||||
|
case job.name
|
||||||
|
when "Class#expire_cache"
|
||||||
|
"<strong>expire post count cache</strong>"
|
||||||
|
|
||||||
|
when "Upload#process!"
|
||||||
|
"<strong>upload post</strong>"
|
||||||
|
|
||||||
|
when "Tag#update_related"
|
||||||
|
"<strong>update related tags</strong>"
|
||||||
|
|
||||||
|
when "TagAlias#process!"
|
||||||
|
"<strong>alias</strong>"
|
||||||
|
|
||||||
|
when "TagImplication#process!"
|
||||||
|
"<strong>implication</strong>"
|
||||||
|
|
||||||
|
when "Class#clear_cache_for"
|
||||||
|
"<strong>expire tag alias cache</strong>"
|
||||||
|
|
||||||
|
when "Tag#update_category_cache"
|
||||||
|
"<strong>update tag category cache</strong>"
|
||||||
|
|
||||||
|
when "Tag#update_category_post_counts"
|
||||||
|
"<strong>update category post counts</strong>"
|
||||||
|
|
||||||
|
else
|
||||||
|
h(job.name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def print_handler(job)
|
def print_handler(job)
|
||||||
case job.name
|
case job.name
|
||||||
when "Class#expire_cache"
|
when "Class#expire_cache"
|
||||||
"<strong>expire post count cache</strong>: " + h(job.payload_object.args.flatten.join(" "))
|
h(job.payload_object.args.flatten.join(" "))
|
||||||
|
|
||||||
when "Upload#process!"
|
when "Upload#process!"
|
||||||
'<strong>upload post</strong>: <a href="/uploads/' + job.payload_object.object.id.to_s + '">record</a>'
|
%{<a href="/uploads/#{job.payload_object.object.id}">record</a>}
|
||||||
|
|
||||||
when "Tag#update_related"
|
when "Tag#update_related"
|
||||||
"<strong>update related tags</strong>: " + h(job.payload_object.name)
|
h(job.payload_object.name)
|
||||||
|
|
||||||
when "TagAlias#process!"
|
when "TagAlias#process!"
|
||||||
'<strong>alias</strong>: ' + h(job.payload_object.antecedent_name) + " -> " + h(job.payload_object.consequent_name)
|
h(job.payload_object.antecedent_name) + " -> " + h(job.payload_object.consequent_name)
|
||||||
|
|
||||||
when "TagImplication#process!"
|
when "TagImplication#process!"
|
||||||
'<strong>implication</strong>: ' + h(job.payload_object.antecedent_name) + " -> " + h(job.payload_object.consequent_name)
|
h(job.payload_object.antecedent_name) + " -> " + h(job.payload_object.consequent_name)
|
||||||
|
|
||||||
when "Class#clear_cache_for"
|
when "Class#clear_cache_for"
|
||||||
"<strong>expire tag alias cache</strong>: " + h(job.payload_object.args.flatten.join(" "))
|
h(job.payload_object.args.flatten.join(" "))
|
||||||
|
|
||||||
when "Tag#update_category_cache"
|
when "Tag#update_category_cache"
|
||||||
"<strong>update tag category cache</strong>: " + h(job.payload_object.name)
|
h(job.payload_object.name)
|
||||||
|
|
||||||
when "Tag#update_category_post_counts"
|
when "Tag#update_category_post_counts"
|
||||||
"<strong>update category post counts</strong>: " + h(job.payload_object.name)
|
h(job.payload_object.name)
|
||||||
|
|
||||||
else
|
else
|
||||||
h(job.handler)
|
h(job.handler)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
<th>Name</th>
|
||||||
<% if CurrentUser.is_admin? %>
|
<% if CurrentUser.is_admin? %>
|
||||||
<th>Handler</th>
|
<th>Handler</th>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -19,6 +20,7 @@
|
|||||||
<% @delayed_jobs.each do |job| %>
|
<% @delayed_jobs.each do |job| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= job.id %></td>
|
<td><%= job.id %></td>
|
||||||
|
<td><%= raw print_name(job) %></td>
|
||||||
<% if CurrentUser.is_admin? %>
|
<% if CurrentUser.is_admin? %>
|
||||||
<td><%= raw print_handler(job) %></td>
|
<td><%= raw print_handler(job) %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user