Browse Source

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

Fixes #779
Colin Shea 10 years ago
parent
commit
48dcd72b74
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/views/jobs/index.html.erb

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

@@ -11,6 +11,7 @@
         <table class='table table-striped events'>
           <tr>
             <th>Status</th>
+            <th>Agent</th>
             <th>Created</th>
             <th>Next Run</th>
             <th>Attempts</th>
@@ -19,9 +20,11 @@
           </tr>
 
         <% @jobs.each do |job| %>
+          <% agent = Agent.find(YAML.load(job.handler).args[0]) %>
           <tr>
             <td><%= status(job) %></td>
-            <td title='<%= job.created_at %>'><%= time_ago_in_words job.created_at %> ago</td>
+            <td><%= link_to agent.name, agent_path(agent) %></td>
+            <td title='<%= job.created_at %>'><%= time_ago_in_words job.created_at %> ago for <%= agent.user.username %></td>
             <td title='<%= job.run_at %>'>
               <% if !job.failed_at %>
                 <%= relative_distance_of_time_in_words job.run_at %>