swirl/views/image/detail.jet
2018-03-16 16:50:03 +08:00

105 lines
3.4 KiB
Go

{{ extends "../_layouts/default" }}
{{ import "../_modules/detail" }}
{{ block body() }}
<section class="hero is-info">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title is-2 is-uppercase">{{ i18n("image.title") }}</h1>
<h2 class="subtitle is-5">{{ i18n("image.description") }}</h2>
</div>
</div>
</section>
<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="/image/">{{ i18n("menu.image") }}</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">
{{ limit(.Image.ID, 32) }}
</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="/image/{{ .Image.ID }}/detail">{{ i18n("menu.detail") }}</a>
<a class="navbar-item is-tab" href="/image/{{ .Image.ID }}/raw">{{ i18n("menu.raw") }}</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">{{ i18n("field.id") }}</dt>
<dd>{{ .Image.ID }}</dd>
<dt class="has-text-left">{{ i18n("field.size") }}</dt>
<dd>{{ printf("%0.1f", .Image.Size / 1024 / 1024) }} MB</dd>
<dt class="has-text-left">{{ i18n("field.created-at") }}</dt>
<dd>{{ .Image.Created }}</dd>
<dt class="has-text-left">Docker {{ i18n("image.docker-version") }}</dt>
<dd>{{ .Image.DockerVersion }}</dd>
<dt class="has-text-left">{{ i18n("image.platform") }}</dt>
<dd>{{ .Image.Os }}/{{ .Image.Architecture }}</dd>
{{ if .Image.Author }}
<dt class="has-text-left">{{ i18n("image.author") }}</dt>
<dd>{{ .Image.Author }}</dd>
{{ end }}
{{ if .Image.RepoTags }}
<dt class="has-text-left">{{ i18n("field.tag") }}</dt>
{{ range .Image.RepoTags }}
<dd><span class="tag is-success">{{ . }}</span></dd>
{{ end }}
{{ end }}
</dl>
</div>
</div>
{{ if .Histories }}
<div class="block">
<div class="block-header">
<p>{{ i18n("image.layer") }}</p>
</div>
<div class="block-body is-paddingless">
<table id="table-containers" class="table is-bordered is-striped is-narrow is-fullwidth is-marginless">
<thead>
<tr>
<th>{{ i18n("image.instruction") }}</th>
<th>{{ i18n("field.size") }}</th>
</tr>
</thead>
<tbody>
{{ range .Histories }}
<tr>
<td>{{ trimPrefix(.CreatedBy, "/bin/sh -c #(nop) ") }}</td>
<td>{{ printf("%0.1f", .Size / 1024 / 1024) }} MB</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</div>
{{end}}
<a href="/image/" class="button is-primary">
<span class="icon"><i class="fas fa-reply"></i></span>
<span>{{ i18n("button.return") }}</span>
</a>
</div>
</section>
{{ end }}