VEL-Connect/velconnect/templates/index.jinja

85 lines
2.3 KiB
Django/Jinja

<html>
<head>
<link rel="apple-touch-icon" sizes="180x180" href="/static/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicons/favicon-16x16.png">
<link rel="manifest" href="/static/favicons/site.webmanifest">
<link rel="mask-icon" href="/static/favicons/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#b91d47">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="/static/css/spectre.min.css">
<script src="/static/js/util.js"></script>
<style>
.container {
max-width: 30em;
}
.card {
margin: 1em;
box-shadow: 0 0 2em #0003;
}
.centered {
margin: auto;
}
</style>
</head>
<body>
<div class="container">
<div id="loading" class="loading loading-lg"></div>
<div id="failure">☹️</div>
<div id="headset_details" style="display: none;">
<h2>HW ID</h2>
<p id="hw_id"></p>
</div>
</div>
<script>
let submit_button = document.getElementById('submit_pairing_code');
let pair_code_input = document.getElementById('pair_code');
let loading = document.getElementById('loading');
let enter_pairing_id = document.getElementById('enter_pairing_id');
let headset_details = document.getElementById('headset_details');
let hw_id_field = document.getElementById('hw_id');
let failure = document.getElementById('failure');
// check cookie
let hw_id = getCookie('hw_id');
loading.style.display = "none";
if (hw_id != "") {
httpGetAsync('/api/get_headset_details/' + hw_id, (resp) => {
console.log(resp);
let respData = JSON.parse(resp);
if (respData['hw_id'] != '') {
hw_id_field.innerText = respData['hw_id'];
}
headset_details.style.display = "block";
}, (status) => {
failure.style.display = "block";
});
} else {
window.location.href = "/pair";
}
</script>
</body>
</html>