swirl/views/network/detail.jet
2017-10-10 15:26:07 +08:00

118 lines
3.4 KiB
Go

{{ extends "../_layouts/default" }}
{{ import "../_modules/detail" }}
{{ block script() }}
<script>$(() => new Swirl.Network.DetailPage())</script>
{{ end }}
{{ block body() }}
<section class="hero is-info">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title is-2">
NETWORK
</h1>
<h2 class="subtitle is-5">
Networks are user-defined networks that containers can be attached to.
</h2>
</div>
</div>
</section>
<div class="container">
<nav class="breadcrumb has-succeeds-separator is-small is-marginless" aria-label="breadcrumbs">
<ul>
<li><a href="/">Dashboard</a></li>
<li><a href="/network/">Networks</a></li>
<li class="is-active"><a>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">
{{ .Network.Name }}
</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="/network/{{.Network.Name}}/detail">
Detail
</a>
<a class="navbar-item is-tab" href="/network/{{.Network.Name}}/raw">
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">ID</dt>
<dd>{{ .Network.ID }}</dd>
<dt class="has-text-left">Driver</dt>
<dd>{{ .Network.Driver }}</dd>
<dt class="has-text-left">Scope</dt>
<dd>{{ .Network.Scope}}</dd>
<dt class="has-text-left">Created at</dt>
<dd>{{ time(.Network.Created) }}</dd>
{{ if .Network.IPAM.Config }}
<dt class="has-text-left">IP</dt>
{{range .Network.IPAM.Config}}
<dd>Subnet: {{ .Subnet }}, Gateway: {{ .Gateway }}</dd>
{{end}}
{{end}}
</dl>
</div>
</div>
{{ yield tags(title="Options", tags=.Network.Options) }}
{{ yield tags(title="Labels", tags=.Network.Labels) }}
{{if .Network.Containers}}
<div class="block">
<div class="block-header">
<p>Containers</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>Name</th>
<th>IPV4</th>
<th>IPV6</th>
<th>Mac</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{{range id, c := .Network.Containers}}
<tr>
<td><a href="/container/{{id}}/detail">{{c.Name}}</a></td>
<td>{{c.IPv4Address}}</td>
<td>{{c.IPv6Address}}</td>
<td>{{c.MacAddress}}</td>
<td>
<button class="button is-small is-danger is-outlined" data-action="disconnect" value="{{id}}">Leave</button>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</div>
{{end}}
<a href="/network/" class="button is-primary">
<span class="icon"><i class="fa fa-reply"></i></span>
<span>Return</span>
</a>
</div>
</section>
{{ end }}