39 lines
1.4 KiB
HTML
39 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="//code.jquery.com/jquery-1.12.4.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js" integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" crossorigin="anonymous"></script>
|
|
<script type="text/javascript" charset="utf-8">
|
|
$(document).ready(function() {
|
|
var socket = io();
|
|
socket.on('connect', function() {
|
|
socket.emit('my_event', {data: 'Connected to server'});
|
|
});
|
|
socket.on('qr_used', function(msg, cb) {
|
|
location.reload(true);
|
|
/*
|
|
$('#log').append('<li>' + msg.data[0] + ': ' + msg.data[1] + ' (' + msg.data[2] + ')</li>');
|
|
$('#qrcode').attr('src',src);
|
|
if (cb)
|
|
cb();
|
|
*/
|
|
});
|
|
});
|
|
</script>
|
|
<title>Example</title>
|
|
</head>
|
|
<body>
|
|
<h1>QR Code:</h1>
|
|
<p>For URL <a href="{{ request.url_root + next_uuid }}">{{ request.url_root + next_uuid }}</a></p>
|
|
<img id="qrcode" src="{{ qrcode(request.url_root + next_uuid, box_size=12, border=5) }}">
|
|
<h1>Last 10 users:</h1>
|
|
<!-- div><ul id="log"></ul></div -->
|
|
<ul>
|
|
{% for hit in hits %}
|
|
<li>{{ hit['created'] }}, {{ hit['user'] }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</body>
|
|
</html>
|
|
|