goacc/pkg/server/templates/userSessions.html
2022-07-10 15:51:31 +02:00

50 lines
1.6 KiB
HTML

{{define "body"}}
<div class="page-header">
<div class="row">
<h2>{{.BodyTitle}}</h2>
</div>
</div>
{{$user := .User}}
{{$token := .Token}}
{{if .Data}}
<div class="row mb-3">
<div class="col-xs-5">
<form class="form-horizontal" action="/user/sessions/{{$user}}" method="post">
<input type="hidden" name="token" value="{{$token}}">
<input type="hidden" name="all" value="all">
<button class="btn btn-sm btn-danger" type="submit">Revoke All</button>
</form>
</div>
</div>
{{end}}
<div class="row">
<div class="col">
{{if .Data}}
<table class="table table-hover">
<thead><tr>
<th scope="col">Client Name</th>
<th scope="col">Created</th>
<th scope="col">Options</th>
</tr></thead>
<tbody>
{{range $name, $s := .Data}}
<tr>
<th scope="row">{{$name}}</th>
<td>{{$s.Time}}</td>
<td>
<form class="form-horizontal" action="/user/sessions/{{$user}}" method="post">
<input type="hidden" name="token" value="{{$token}}">
<input type="hidden" name="client" value="{{$s.ID}}">
<button class="btn btn-sm btn-warning" type="submit">Revoke</button>
</form>
</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
No active sessions found.
{{end}}
</div>
</div>
{{end}}