mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
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:
parent
e436a89f9a
commit
f1ecae6deb
2 changed files with 12 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue