stop-server
Version:
Stop your computer using your phone or your tablet, from your bed or your couch
38 lines (36 loc) • 1.14 kB
HTML
<html>
<head>
<meta charset="utf-8">
<title>stop-server</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.5/flatly/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<p>
<div id="qrcode"></div>
</p>
<p>
Scan this QR code or go to<br>
<span id="url"></span><br>
on your phone or tablet.
</p>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
<script>
$.get('/address')
.done(function (data) {
var address = data.address
var url = 'http://' + address + ':5709'
var a = '<a href="' + url + '">' + url + '</a>'
$('#qrcode').qrcode(url)
$('#url').html(a)
})
.fail(function () {
alert('Can\'t get server address')
})
</script>
</body>
</html>