Show the agent's name and user in the jobs panel

Fixes #779

Colin Shea преди 10 години
родител
ревизия
48dcd72b74
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      app/views/jobs/index.html.erb

+ 4 - 1
app/views/jobs/index.html.erb

@@ -11,6 +11,7 @@
11 11
         <table class='table table-striped events'>
12 12
           <tr>
13 13
             <th>Status</th>
14
+            <th>Agent</th>
14 15
             <th>Created</th>
15 16
             <th>Next Run</th>
16 17
             <th>Attempts</th>
@@ -19,9 +20,11 @@
19 20
           </tr>
20 21
 
21 22
         <% @jobs.each do |job| %>
23
+          <% agent = Agent.find(YAML.load(job.handler).args[0]) %>
22 24
           <tr>
23 25
             <td><%= status(job) %></td>
24
-            <td title='<%= job.created_at %>'><%= time_ago_in_words job.created_at %> ago</td>
26
+            <td><%= link_to agent.name, agent_path(agent) %></td>
27
+            <td title='<%= job.created_at %>'><%= time_ago_in_words job.created_at %> ago for <%= agent.user.username %></td>
25 28
             <td title='<%= job.run_at %>'>
26 29
               <% if !job.failed_at %>
27 30
                 <%= relative_distance_of_time_in_words job.run_at %>