summaryrefslogtreecommitdiff
path: root/templates/api_keys.html
blob: cd4d274bf91e93ba0304da99c930dfb70edc1ba1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{{ define "content" }}
  <table>
    <tr>
      <th>key.</th>
      <th>created at.</th>
      <th>revoke.</th>
    </tr>
    {{ if (eq (len .APIKeys) 0) }}
    <tr>
      <td colspan="5"><span class="blinky">no api keys found</span></td>
    </tr>
    {{ end }}
    {{ range $key := .APIKeys }}
      <tr>
	<td>{{ $key.Key }}</td>
	<td class="time">{{ $key.CreatedAt }}</td>
	<td>
	  <form method="POST" action="/keys/delete">
	    <input type="hidden" name="key" value="{{ $key.Key }}" />
	    <input type="submit" value="revoke." />
	  </form>
	</td>
      </tr>
    {{ end }}
  </table>
  <br>
  <form method="POST" action="/keys" class="form">
    <h2>generate key.</h2>
    <hr>
    <input type="submit" value="generate." />
    {{ if .FormError }}
    {{ if (len .FormError.Errors) }}
    {{ range $error := .FormError.Errors }}
    <div class="error">{{ $error }}</div>
    {{ end }}
    {{ end }}
    {{ end }}
  </form>
{{ end }}