Process

/views/vexec/Table.html (1.4 KB)

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{% import (
"{{{ .Package }}}/app"
"{{{ .Package }}}/app/controller/cutil"
"{{{ .Package }}}/app/lib/exec"
"{{{ .Package }}}/app/util"
) %}

{% func Table(execs exec.Execs, as *app.State, ps *cutil.PageState) %}
<div class="overflow full-width">
<table class="mt expanded">
<thead>
<tr>
<th class="shrink">Key</th>
<th>#</th>
<th>Started</th>
<th>Completed</th>
<th>Exit</th>
</tr>
</thead>
<tbody>
{%- if len(execs) == 0 -%}
<tr><td colspan="2"><em>no processes</em></td></tr>
{%- endif -%}
{%- for _, exec := range execs -%}
<tr>
<td class="shrink"><a href="{%s exec.WebPath() %}">{%s exec.Key %}</a></td>
<td><a href="{%s exec.WebPath() %}">{%d exec.Idx %}</a></td>
<td><span title="{%s util.TimeToFull(exec.Started) %}">{% if exec.Started == nil %}-{% else %}{%s util.TimeRelative(exec.Started) %}{% endif %}</span></td>
<td><span title="{%s util.TimeToFull(exec.Completed) %}">{% if exec.Completed == nil %}-{% else %}{%s util.TimeRelative(exec.Completed) %}{% endif %}</span></td>
<td>{% if exec.Completed != nil %}{% if exec.ExitCode == 0 %}<span class="success">0</span>{% else %}<span class="error">{%d exec.ExitCode %}</span>{% endif %}{% endif %}</td>
</tr>
{%- endfor -%}
</tbody>
</table>
</div>
{% endfunc %}