Fix internal jobs beeing shown as deleted

Show more information about previosly labeled "(internal)" jobs that are now available due to the switch to ActiveJob.

Fixes #1460
This commit is contained in:
Dominik Sander 2016-04-29 16:58:45 +02:00
parent e436a89f9a
commit f1ecae6deb
2 changed files with 12 additions and 2 deletions

View file

@ -24,8 +24,16 @@ module JobsHelper
#
# Can return nil, or an instance of Agent.
def agent_from_job(job)
if data = YAML.load(job.handler.to_s).try(:job_data)
data = YAML.load(job.handler.to_s).try(:job_data)
case data['job_class']
when 'AgentCheckJob', 'AgentReceiveJob'
Agent.find_by_id(data['arguments'][0])
when 'AgentRunScheduleJob'
"Run Agent schedule '#{data['arguments'][0]}'"
when 'AgentCleanupExpiredJob'
'Run Event cleanup'
when 'AgentPropagateJob'
'Run Event propagation'
else
false
end

View file

@ -11,7 +11,7 @@
<table class='table table-striped events'>
<tr>
<th>Status</th>
<th>Agent</th>
<th>Agent / Job</th>
<th>Created</th>
<th>Next Run</th>
<th>Attempts</th>
@ -25,6 +25,8 @@
<td><% case agent = agent_from_job(job)
when Agent
%><%= link_to(agent.name, agent_path(agent)) %><%
when String
%><%= agent %><%
when false
%>(system)<%
when nil