ovpn-certman/assets/templates/views/client_list.gohtml

69 lines
3.4 KiB
Text
Raw Normal View History

2018-02-01 09:31:06 +01:00
{{ define "meta" }}
2018-02-03 18:14:47 +01:00
<title>Certificate List</title>
2018-02-01 09:31:06 +01:00
{{ end}}
{{ define "content" }}
<section class="content">
<div class="section">
<div class="container">
<div class="columns">
<div class="column">
2018-02-03 18:14:47 +01:00
<h1 class="title">Certificates for {{ .username }}:</h1>
2018-02-01 09:31:06 +01:00
<table class="table">
<thead>
<th>Device</th>
<th width="20%">Created</th>
<th width="20%" class="has-text-centered">Actions</th>
</thead>
<tfoot>
<form action="/certs/new" method="POST">
<th colspan="2">
<div class="field has-addons">
<p class="control is-marginless">
<a class="button is-static">
{{ $.username }}@
</a>
</p>
2018-02-03 18:14:47 +01:00
<p class="control is-marginless is-expanded">
2018-02-01 09:31:06 +01:00
<input name="certname" class="input" type="text" placeholder="Certificate name (e.g. Laptop)">
</p>
</div>
</th>
<th>{{ .csrfField }}<input type="submit" class="button is-success is-fullwidth" value="Create"/></th>
</form>
</tfoot>
<tbody>
{{ range .Clients }}
<tr>
2018-02-03 18:14:47 +01:00
<td class="is-vcentered"><p>{{ .User }}@{{ .Name }}</p></td>
2018-02-01 09:31:06 +01:00
<td><time title="{{ .CreatedAt.UTC }}">{{ .CreatedAt | humanDate }}</time></td>
<td>
<div class="field has-addons">
<p class="control is-marginless is-expanded">
<a href="/certs/download/{{ .Name }}" class="button is-primary is-fullwidth">Download</a>
</p>
2018-02-03 18:14:47 +01:00
<div class="control is-marginless">
<form action="/certs/delete/{{ .Name }}" method="POST">
{{ $.csrfField }}
<button class="button is-danger" type="submit">
<span class="icon is-small">
<i class="fas fa-trash"></i>
</span>
</button>
</form>
</div>
2018-02-01 09:31:06 +01:00
</div>
</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
{{ end}}