-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.html
More file actions
72 lines (64 loc) · 2.14 KB
/
Copy pathapi.html
File metadata and controls
72 lines (64 loc) · 2.14 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{% extends "base.html" %}
{% block extra_js %}
<script type="text/javascript" src="/static/js/jquery.qrcode-0.7.0.min.js"></script>
{% endblock extra_js %}
{% block extra_head %}
<script>
function showQR(text) {
$('#qr').text("").qrcode({
text: text,
});
$('#qrModal').modal();
};
</script>
{% endblock extra_head %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1> API keys </h1>
<table class="table table-striped">
<tr><th>key</th><th></th><th>created</th><th>description</th><th></th></tr>
{% for key in keys %}
<tr><td>{{ key.key }}</td>
<td><button type="submit" class="btn btn-sm btn-info" onclick="showQR('{{key.key}}')"><span class="glyphicon glyphicon-qrcode"></span></button></td>
<td>{{ key.created }}</td><td>{{ key.name }}</td>
<td>
<form method="POST" action="/api/remove">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<input type="hidden" name="key_id" value="{{ key.key }}">
<button type="submit" class="btn btn-sm btn-danger">Remove</button>
</form>
</td>
{% endfor %}
</table>
<form class="form-horizontal" role="form" method="POST" action="/api/new" id="adduserform">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="form-group">
<div class="col-lg-6">
<input type="text" class="form-control" name="description" placeholder="Description (optional)">
</div>
<div class="col-lg-6">
<button type="submit" class="btn btn-default">Add</button>
</div>
</div>
</form>
<div class="modal fade" id="qrModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">QRCode</h4>
</div>
<div class="modal-body" id="qr">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}