aboutsummaryrefslogtreecommitdiff
path: root/server/templates
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-08-28 20:55:30 +0100
committerNiall Sheridan <nsheridan@gmail.com>2016-08-28 20:55:30 +0100
commit9c58d4d6a324ed8422ef691471868d760b64f7bd (patch)
tree6599d7eab4c678a963d6cb551e9203f69cf7610f /server/templates
parenta5602dd8cdec8cb8ce85cbc5fab29a91f533d2af (diff)
Allow searching on keyID and principals
Diffstat (limited to 'server/templates')
-rw-r--r--server/templates/certs.go63
1 files changed, 36 insertions, 27 deletions
diff --git a/server/templates/certs.go b/server/templates/certs.go
index cf4c7d1..89ec5a1 100644
--- a/server/templates/certs.go
+++ b/server/templates/certs.go
@@ -19,36 +19,45 @@ const Certs = `
<h2>Issued SSH Certificates</h2>
</div>
- <form action="/admin/revoke" method="post" id="form_revoke">
- {{ .CSRF }}
- <table>
- <thead>
- <tr>
- <th>ID</th>
- <th>Created</th>
- <th>Expires</th>
- <th>Principals</th>
- <th>Revoked</th>
- <th>Revoke</th>
- </tr>
- </thead>
- <tbody>
- {{range .Certs}}
+ <div id="issued">
+ <input class="u-full-width search" type="text" placeholder="Search" id="q" />
+ <form action="/admin/revoke" method="post" id="form_revoke">
+ {{ .CSRF }}
+ <table id="cert-table">
+ <thead>
<tr>
- <td>{{.KeyID}}</td>
- <td>{{.CreatedAt}}</td>
- <td>{{.Expires}}</td>
- <td>{{.Principals}}</td>
- <td>{{.Revoked}}</td>
- <td>{{if not .Revoked}}<input style="margin:0;" type="checkbox" value="{{.KeyID}}" name="cert_id" id="cert_id" />{{end}}</td>
+ <th>ID</th>
+ <th>Created</th>
+ <th>Expires</th>
+ <th>Principals</th>
+ <th>Revoked</th>
+ <th>Revoke</th>
</tr>
- {{ end }}
- </tbody>
- </table>
- </form>
- <button class="button-primary" type="submit" form="form_revoke" value="Submit">Submit</button>
+ </thead>
+ <tbody class="list">
+ {{range .Certs}}
+ <tr>
+ <td class="keyid">{{.KeyID}}</td>
+ <td>{{.CreatedAt}}</td>
+ <td>{{.Expires}}</td>
+ <td class="principals">{{.Principals}}</td>
+ <td>{{.Revoked}}</td>
+ <td>{{if not .Revoked}}<input style="margin:0;" type="checkbox" value="{{.KeyID}}" name="cert_id" id="cert_id" />{{end}}</td>
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+ </form>
+ <button class="button-primary" type="submit" form="form_revoke" value="Submit">Submit</button>
+ </div>
</div>
</body>
+<script src="/static/js/list.min.js"></script>
+<script>
+var options = {
+ valueNames: [ 'keyid', 'principals' ],
+}
+var issuedList = new List('issued', options);
+</script>
</html>
-
`