summaryrefslogtreecommitdiff
path: root/templates/api_keys.html
blob: 93eebd55fe945c4146ecb0c40d42425987162556 (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
40
{{ 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>{{ $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>Add An API Key</h2>
    <hr>
    <input type="submit" value="Generate" />
  </form>

  {{ if .FormError }}
    {{ if (len .FormError.Errors) }}
      {{ range $error := .FormError.Errors }}
        <div class="error">{{ $error }}</div>
      {{ end }}
    {{ end }}
  {{ end }}
{{ end }}