swirl/views/task/detail.jet
2021-02-26 13:32:05 +08:00

107 lines
3.9 KiB
Go

{{ extends "base" }}
{{ block body_content() }}
<div class="container">
<nav class="breadcrumb has-succeeds-separator is-small is-marginless" aria-label="breadcrumbs">
<ul>
<li><a href="/">{{ i18n("menu.home") }}</a></li>
<li><a href="/task/">{{ i18n("menu.task") }}</a></li>
<li class="is-active"><a>{{ i18n("menu.detail") }}</a></li>
</ul>
</nav>
</div>
<section class="hero is-small is-light">
<div class="hero-body">
<div class="container">
<h2 class="title is-2">
{{ .Task.Name ? .Task.Name : .Task.ID }}
</h2>
</div>
</div>
</section>
<nav class="navbar has-shadow">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item is-tab is-active" href="/task/{{.Task.ID}}/detail">{{ i18n("menu.detail") }}</a>
<a class="navbar-item is-tab " href="/task/{{.Task.ID}}/raw">{{ i18n("menu.raw") }}</a>
<a class="navbar-item is-tab" href="/task/{{.Task.ID}}/logs">{{ i18n("menu.log") }}</a>
</div>
</div>
</nav>
<section class="section">
<div class="container">
<div class="message is-primary">
<div class="message-body">
<dl class="is-horizontal is-marginless">
<dt class="has-text-left">ID</dt>
<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>
{{ end }}
{{ if .Task.Status.ContainerStatus.PID }}
<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>
<dd>{{ time(.Task.CreatedAt) }}</dd>
<dt class="has-text-left">Updated at</dt>
<dd>{{ time(.Task.UpdatedAt) }}</dd>
<dt class="has-text-left">State</dt>
<dd><span class="tag is-{{ .Task.Status.State == "running" ? "success" : (.Task.Status.State == "preparing" ? "warning": "danger") }}">{{ .Task.Status.State }}</span></dd>
{{ if .Task.Status.Message }}
<dt class="has-text-left">Message</dt>
<dd>{{ .Task.Status.Message }}</dd>
{{ end }}
{{ if .Task.Status.Err }}
<dt class="has-text-left">Error</dt>
<dd class="has-text-danger">{{ .Task.Status.Err }}</dd>
{{ end }}
</dl>
</div>
</div>
{{ if .Task.NetworksAttachments }}
<div class="block">
<div class="block-header">
<p>Networks</p>
</div>
<div class="block-body is-paddingless">
<table class="table is-bordered is-narrow is-fullwidth is-marginless">
<thead>
<tr>
<th>Name</th>
<th>ID</th>
<th>Addresses</th>
</tr>
</thead>
<tbody>
{{ range .Task.NetworksAttachments }}
<tr>
<td><a href="/network/{{.Network.Spec.Name}}/detail">{{.Network.Spec.Name}}</a></td>
<td>{{.Network.ID}}</td>
<td>{{.Addresses}}</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
{{ end }}
<a href="/task/" class="button is-primary">
<span class="icon"><i class="fas fa-reply"></i></span>
<span>{{ i18n("button.return") }}</span>
</a>
</div>
</section>
{{ end }}