swirl/views/node/list.jet

62 lines
2.1 KiB
Go
Raw Normal View History

2017-09-26 12:50:09 +00:00
{{ extends "../_layouts/default" }}
{{ block script() }}
<script>$(() => new Swirl.Node.ListPage())</script>
{{ end }}
{{ 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("node.title") }}</h1>
<h2 class="subtitle is-5">{{ i18n("node.description") }}</h2>
2017-09-26 12:50:09 +00:00
</div>
</div>
</section>
<section class="section">
<nav class="level">
<!-- Left side -->
<div class="level-left">
<div class="level-item">
<p class="subtitle is-5">
<strong>{{len(.Nodes)}}</strong>
<span class="is-lowercase">{{ i18n("menu.node") }}</span>
2017-09-26 12:50:09 +00:00
</p>
</div>
</div>
</nav>
2018-04-23 08:36:19 +00:00
<table id="table-items" class="table is-bordered is-striped is-hoverable is-narrow is-fullwidth">
2017-09-26 12:50:09 +00:00
<thead>
<tr>
<th>{{ i18n("field.name") }}</th>
2017-09-26 12:50:09 +00:00
<th>Role</th>
<th>Version</th>
<th>CPU</th>
<th>Memory</th>
2017-10-16 12:49:09 +00:00
<th>{{ i18n("field.address") }}</th>
<th>{{ i18n("field.status") }}</th>
<th>{{ i18n("field.action") }}</th>
2017-09-26 12:50:09 +00:00
</tr>
</thead>
<tbody>
{{range .Nodes}}
<tr>
<td><a href="{{.ID}}/detail">{{.Name}}</a></td>
2018-01-26 05:10:38 +00:00
<td>{{.Role}}{{ if .Role == "manager" && .Leader }}<span class="icon has-text-danger tooltip" data-tooltip="Leader"><i class="fas fa-flag"></i></span>{{ end }}</td>
2017-09-26 12:50:09 +00:00
<td>{{.Version}}</td>
<td>{{.CPU}}</td>
<td>{{printf("%.2f", .Memory)}} GB</td>
<td>{{.Address}}</td>
<td><span class="tag is-{{.Status == "ready" ? "success" : (.Status == "down" ? "danger" : "warning")}}">{{.Status}}</span></td>
<td>
<a href="{{.ID}}/edit" class="button is-small is-dark is-outlined">{{ i18n("button.edit") }}</a>
<button class="button is-small is-danger is-outlined" data-action="delete-node" value="{{.ID}}">{{ i18n("button.delete") }}</button>
2017-09-26 12:50:09 +00:00
</td>
</tr>
{{end}}
</tbody>
</table>
</section>
{{ end }}