Add container status check to fix page crash

This commit is contained in:
cuigh 2018-07-20 16:11:24 +08:00
parent b34ef70c66
commit f593d20051

View File

@ -37,6 +37,7 @@
<dd>{{ .Task.ID }}</dd>
<dt class="has-text-left">Service ID</dt>
<dd><a href="/service/{{ .Task.ServiceID }}/detail">{{ .Task.ServiceID }}</a></dd>
{{ if .Task.Status.ContainerStatus }}
{{ if .Task.Status.ContainerStatus.ContainerID }}
<dt class="has-text-left">Container ID</dt>
<dd><a href="/container/{{ .Task.Status.ContainerStatus.ContainerID }}/detail">{{ .Task.Status.ContainerStatus.ContainerID }}</a></dd>
@ -45,6 +46,11 @@
<dt class="has-text-left">PID</dt>
<dd>{{ .Task.Status.ContainerStatus.PID }}</dd>
{{ end }}
{{ if .Task.Status.ContainerStatus.ExitCode }}
<dt class="has-text-left">Exit code</dt>
<dd>{{ .Task.Status.ContainerStatus.ExitCode }}</dd>
{{ end }}
{{ end }}
<dt class="has-text-left">Image</dt>
<dd>{{ .Task.Spec.ContainerSpec.Image }}</dd>
<dt class="has-text-left">Created at</dt>