117 lines
4.1 KiB
Django/Jinja
117 lines
4.1 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" style="display: none;">☹️</div>
|
|
|
|
|
|
<div id="headset_details" style="display: none;">
|
|
<div class="panel">
|
|
<div class="panel-header text-center">
|
|
<figure class="avatar avatar-lg"><img src="static/favicon/android-chrome-192x192.png" alt="Avatar"></figure>
|
|
<div class="panel-title h5 mt-10">Headset Info</div>
|
|
<div class="panel-subtitle hw_id">---</div>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div class="tile tile-centered">
|
|
<div class="tile-content">
|
|
<div class="tile-title text-bold">Current Room</div>
|
|
<input class="btn" type="text" id="current_room" placeholder="----">
|
|
</div>
|
|
<div class="tile-action">
|
|
<button class="btn btn-link btn-action btn-lg tooltip tooltip-left"
|
|
data-tooltip="Set Room ID"><i class="icon icon-send"></i></button>
|
|
</div>
|
|
</div>
|
|
<div class="tile tile-centered">
|
|
<div class="tile-content">
|
|
<div class="tile-title text-bold">First Added</div>
|
|
<div class="tile-subtitle date_created">---</div>
|
|
</div>
|
|
</div>
|
|
<div class="tile tile-centered">
|
|
<div class="tile-content">
|
|
<div class="tile-title text-bold">Last Used</div>
|
|
<div class="tile-subtitle last_used">---</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</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);
|
|
|
|
writeClass('hw_id', respData['hw_data']);
|
|
writeClass('current_room', respData['current_room']);
|
|
writeClass('date_created', respData['date_created']);
|
|
writeClass('last_used', respData['last_used']);
|
|
|
|
headset_details.style.display = "block";
|
|
}, (status) => {
|
|
failure.style.display = "block";
|
|
});
|
|
|
|
} else {
|
|
window.location.href = "/pair";
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html> |