1[% IF NOT results.size %]
2<div class="span2 alert alert-info">The job queue is empty.</div>
3[% ELSE %]
4<table class="table table-bordered table-condensed table-hover nd_floatinghead">
5  <thead>
6    <tr>
7      <th class="nd_center-cell">Entered</th>
8      <th class="nd_center-cell">Action</th>
9      <th class="nd_center-cell">Status</th>
10      <th class="nd_center-cell">Device</th>
11      <th class="nd_center-cell">Port</th>
12      <th class="nd_center-cell">Param</th>
13      <th class="nd_center-cell">User</th>
14      <th class="nd_center-cell">Started</th>
15      <th class="nd_center-cell">Finished</th>
16      <th class="nd_center-cell">Action</th>
17    </tr>
18  </thead>
19  <tbody>
20    [% FOREACH row IN results %]
21    <tr
22      [% ' class="nd_jobqueueitem success"' IF row.status == 'done' %]
23      [% ' class="nd_jobqueueitem error"'   IF row.status == 'error' %]
24      [% ' class="nd_jobqueueitem info"'    IF row.status.search('^queued-') %]
25      data-content="<pre>[% row.log | html_entity %]</pre>"
26    >
27      <td class="nd_center-cell">[% row.entered_stamp | html_entity %]</td>
28      <td class="nd_center-cell">
29        [% FOREACH word IN row.action.split('_') %]
30        [% word.ucfirst | html_entity %]&nbsp;
31        [% END %]
32      </td>
33      [% IF row.status.search('^queued-') %]
34      <td class="nd_center-cell">Running on &quot;[% row.status.remove('^queued-') | html_entity %]&quot;</td>
35      [% ELSE %]
36      <td class="nd_center-cell">[% row.status.ucfirst | html_entity %]</td>
37      [% END %]
38      <td class="nd_center-cell">
39        [% IF row.action == 'discover' AND row.status == 'error' %]
40        <a href="[% uri_for('/') | none %]?device=[% row.device | uri %]">[% row.device | html_entity %]</a>
41        [% ELSE %]
42        <a href="[% uri_for('/device') | none %]?q=[% row.device | uri %]">[% row.target.dns || row.device | html_entity %]</a>
43        [% END %]
44      </td>
45      <td class="nd_center-cell">[% row.port | html_entity %]</td>
46      <td class="nd_center-cell">[% row.subaction | html_entity %]</td>
47      <td class="nd_center-cell">[% row.username | html_entity %]</td>
48      <td class="nd_center-cell">[% row.started_stamp | html_entity %]</td>
49      <td class="nd_center-cell">[% row.finished_stamp | html_entity %]</td>
50      <td class="nd_center-cell">
51        <input data-form="del" name="job" type="hidden" value="[% row.job | html_entity %]">
52        <button class="btn nd_adminbutton" name="del" type="submit"><i class="icon-trash text-error"></i></button>
53      </td>
54    </tr>
55    [% END %]
56  </tbody>
57</table>
58[% END %]
59
60