switching back to flask because python simple
parent
57f218f3bc
commit
0f4a23f600
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -96,3 +96,60 @@ function writeSrc(className, data) {
|
||||||
e.src = data;
|
e.src = data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function timeSince(date) {
|
||||||
|
|
||||||
|
let seconds = Math.floor((new Date() - date) / 1000);
|
||||||
|
|
||||||
|
let interval = seconds / 31536000;
|
||||||
|
|
||||||
|
if (interval > 1) {
|
||||||
|
return Math.floor(interval) + " years";
|
||||||
|
}
|
||||||
|
interval = seconds / 2592000;
|
||||||
|
if (interval > 1) {
|
||||||
|
return Math.floor(interval) + " months";
|
||||||
|
}
|
||||||
|
interval = seconds / 86400;
|
||||||
|
if (interval > 1) {
|
||||||
|
return Math.floor(interval) + " days";
|
||||||
|
}
|
||||||
|
interval = seconds / 3600;
|
||||||
|
if (interval > 1) {
|
||||||
|
return Math.floor(interval) + " hours";
|
||||||
|
}
|
||||||
|
interval = seconds / 60;
|
||||||
|
if (interval > 1) {
|
||||||
|
return Math.floor(interval) + " minutes";
|
||||||
|
}
|
||||||
|
return Math.floor(seconds) + " seconds";
|
||||||
|
}
|
||||||
|
|
||||||
|
function timeSinceString(date) {
|
||||||
|
|
||||||
|
date = Date.parse(date);
|
||||||
|
let seconds = Math.floor((new Date() - date) / 1000);
|
||||||
|
|
||||||
|
let interval = seconds / 31536000;
|
||||||
|
|
||||||
|
if (interval > 1) {
|
||||||
|
return Math.floor(interval) + " years";
|
||||||
|
}
|
||||||
|
interval = seconds / 2592000;
|
||||||
|
if (interval > 1) {
|
||||||
|
return Math.floor(interval) + " months";
|
||||||
|
}
|
||||||
|
interval = seconds / 86400;
|
||||||
|
if (interval > 1) {
|
||||||
|
return Math.floor(interval) + " days";
|
||||||
|
}
|
||||||
|
interval = seconds / 3600;
|
||||||
|
if (interval > 1) {
|
||||||
|
return Math.floor(interval) + " hours";
|
||||||
|
}
|
||||||
|
interval = seconds / 60;
|
||||||
|
if (interval > 1) {
|
||||||
|
return Math.floor(interval) + " minutes";
|
||||||
|
}
|
||||||
|
return Math.floor(seconds) + " seconds";
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 charecters -->
|
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 charecters -->
|
||||||
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
|
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
|
||||||
|
<title>API Reference</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<rapi-doc
|
<rapi-doc
|
||||||
|
|
@ -10,7 +11,7 @@
|
||||||
primary-color = "#bc1f2d"
|
primary-color = "#bc1f2d"
|
||||||
show-header = "false"
|
show-header = "false"
|
||||||
show-info = "true"
|
show-info = "true"
|
||||||
spec-url = "http://3.141.15.55/api/api_spec.json"
|
spec-url = "{% include 'api_url.html' %}/api/api_spec.json"
|
||||||
default-schema-tab = 'example'
|
default-schema-tab = 'example'
|
||||||
|
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
http://velconnect.crabdance.com
|
||||||
|
|
@ -1,14 +1,6 @@
|
||||||
<html>
|
{% extends 'single.html' %}
|
||||||
|
|
||||||
<head>
|
{% block content %}
|
||||||
|
|
||||||
<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">
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
@ -24,12 +16,8 @@
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="centered">
|
<div class="centered">
|
||||||
🤮 FAIL 🤡
|
🤮 FAIL 🤡
|
||||||
</div>
|
</div>
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
{% endblock %}
|
||||||
|
|
@ -1,19 +1,9 @@
|
||||||
<html>
|
{% extends 'single.html' %}
|
||||||
|
|
||||||
<head>
|
{% block content %}
|
||||||
|
|
||||||
<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>
|
<style>
|
||||||
.container {
|
.container {
|
||||||
max-width: 30em;
|
max-width: 30em;
|
||||||
|
|
@ -33,20 +23,17 @@
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
<div id="loading"><br><br>
|
||||||
<div class="container">
|
<div class="loading loading-lg"></div>
|
||||||
|
</div>
|
||||||
<div id="loading" class="loading loading-lg"></div>
|
<div id="failure" style="display: none;"><br><br><br>☹️</div>
|
||||||
<div id="failure" style="display: none;">☹️</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="headset_details" style="display: none;">
|
<div id="headset_details" style="display: none;">
|
||||||
<div class="panel card">
|
<div class="panel card">
|
||||||
<div class="panel-header text-center">
|
<div class="panel-header text-center">
|
||||||
<figure class="avatar avatar-lg"><img src="/static/favicons/android-chrome-192x192.png"
|
<figure class="avatar avatar-lg"><img src="/static/favicons/android-chrome-192x192.png" alt="Avatar"></figure>
|
||||||
alt="Avatar"></figure>
|
|
||||||
<div class="panel-title h5 mt-10">Headset Info</div>
|
<div class="panel-title h5 mt-10">Headset Info</div>
|
||||||
<div class="panel-subtitle hw_id">---</div>
|
<div class="panel-subtitle hw_id">---</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -64,14 +51,14 @@
|
||||||
<br>
|
<br>
|
||||||
<div class="tile tile-centered">
|
<div class="tile tile-centered">
|
||||||
<div class="tile-content">
|
<div class="tile-content">
|
||||||
<div class="tile-title text-bold">First Added</div>
|
<div class="tile-title text-bold">First Seen</div>
|
||||||
<div class="tile-subtitle date_created">---</div>
|
<div class="tile-subtitle date_created">---</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div class="tile tile-centered">
|
<div class="tile tile-centered">
|
||||||
<div class="tile-content">
|
<div class="tile-content">
|
||||||
<div class="tile-title text-bold">Last Used</div>
|
<div class="tile-title text-bold">Last Login</div>
|
||||||
<div class="tile-subtitle last_used">---</div>
|
<div class="tile-subtitle last_used">---</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -101,7 +88,7 @@
|
||||||
<div class="tile tile-centered">
|
<div class="tile tile-centered">
|
||||||
<div class="tile-content">
|
<div class="tile-content">
|
||||||
<div class="tile-title text-bold">User Color</div>
|
<div class="tile-title text-bold">User Color</div>
|
||||||
<input class="btn user_color" type="color" id="user_color" placeholder="#ffffff">
|
<input class="btn user_color coloris" type="text" id="user_color" placeholder="#ffffff">
|
||||||
</div>
|
</div>
|
||||||
<div class="tile-action">
|
<div class="tile-action">
|
||||||
<button class="btn btn-primary btn-lg tooltip tooltip-left" id="set_user_color"
|
<button class="btn btn-primary btn-lg tooltip tooltip-left" id="set_user_color"
|
||||||
|
|
@ -112,7 +99,7 @@
|
||||||
<div class="tile tile-centered">
|
<div class="tile tile-centered">
|
||||||
<div class="tile-content">
|
<div class="tile-content">
|
||||||
<div class="tile-title text-bold">Carpet Color</div>
|
<div class="tile-title text-bold">Carpet Color</div>
|
||||||
<input class="btn carpet_color" type="color" id="carpet_color" placeholder="#ffffff">
|
<input class="btn carpet_color coloris" type="text" id="carpet_color" placeholder="#ffffff">
|
||||||
</div>
|
</div>
|
||||||
<div class="tile-action">
|
<div class="tile-action">
|
||||||
<button class="btn btn-primary btn-lg tooltip tooltip-left" id="set_carpet_color"
|
<button class="btn btn-primary btn-lg tooltip tooltip-left" id="set_carpet_color"
|
||||||
|
|
@ -124,8 +111,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<script type="text/javascript" src="/static/js/coloris.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
let submit_button = document.getElementById('submit_pairing_code');
|
let submit_button = document.getElementById('submit_pairing_code');
|
||||||
|
|
@ -141,17 +128,16 @@
|
||||||
|
|
||||||
// check cookie
|
// check cookie
|
||||||
let hw_id = getCookie('hw_id');
|
let hw_id = getCookie('hw_id');
|
||||||
loading.style.display = "none";
|
|
||||||
if (hw_id != "") {
|
if (hw_id != "") {
|
||||||
|
|
||||||
httpGetAsync('/api/get_state/' + hw_id, (resp) => {
|
httpGetAsync('{% include "api_url.html" %}/api/get_state/' + hw_id, (resp) => {
|
||||||
console.log(resp);
|
console.log(resp);
|
||||||
let respData = JSON.parse(resp);
|
let respData = JSON.parse(resp);
|
||||||
|
|
||||||
writeClass('hw_id', respData['user']['hw_id']);
|
writeClass('hw_id', respData['user']['hw_id']);
|
||||||
writeValue('current_room', respData['user']['current_room']);
|
writeValue('current_room', respData['user']['current_room']);
|
||||||
writeClass('date_created', respData['user']['date_created']);
|
writeClass('date_created', respData['user']['date_created'] + "<br>" + timeSinceString(respData['user']['date_created']) + " ago");
|
||||||
writeClass('last_used', respData['user']['last_used']);
|
writeClass('last_used', respData['user']['last_used'] + "<br>" + timeSinceString(respData['user']['last_used']) + " ago");
|
||||||
writeValue('user_color', respData['user']['user_color']);
|
writeValue('user_color', respData['user']['user_color']);
|
||||||
writeValue('user_name', respData['user']['user_name']);
|
writeValue('user_name', respData['user']['user_name']);
|
||||||
if (respData['room']) {
|
if (respData['room']) {
|
||||||
|
|
@ -159,20 +145,22 @@
|
||||||
writeValue('carpet_color', respData['room']['carpet_color']);
|
writeValue('carpet_color', respData['room']['carpet_color']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loading.style.display = "none";
|
||||||
headset_details.style.display = "block";
|
headset_details.style.display = "block";
|
||||||
}, (status) => {
|
}, (status) => {
|
||||||
|
loading.style.display = "none";
|
||||||
failure.style.display = "block";
|
failure.style.display = "block";
|
||||||
});
|
});
|
||||||
|
|
||||||
function setUserData(endpoint, data) {
|
function setUserData(endpoint, data) {
|
||||||
httpPostAsync('/api/set_headset_details/' + hw_id + '/' + endpoint,
|
httpPostAsync('{% include "api_url.html" %}/api/set_headset_details/' + hw_id + '/' + endpoint,
|
||||||
data,
|
data,
|
||||||
(resp) => { console.log('success'); },
|
(resp) => { console.log('success'); },
|
||||||
(status) => { console.log('fail'); }
|
(status) => { console.log('fail'); }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function setRoomData(endpoint, data) {
|
function setRoomData(endpoint, data) {
|
||||||
httpPostAsync('/api/set_room_details/' + current_room.value + '/' + endpoint,
|
httpPostAsync('{% include "api_url.html" %}/api/set_room_details/' + current_room.value + '/' + endpoint,
|
||||||
data,
|
data,
|
||||||
(resp) => { console.log('success'); },
|
(resp) => { console.log('success'); },
|
||||||
(status) => { console.log('fail'); }
|
(status) => { console.log('fail'); }
|
||||||
|
|
@ -204,7 +192,23 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
Coloris({
|
||||||
</body>
|
el: '.coloris',
|
||||||
|
swatches: [
|
||||||
|
'#264653',
|
||||||
|
'#2a9d8f',
|
||||||
|
'#e9c46a',
|
||||||
|
'#f4a261',
|
||||||
|
'#e76f51',
|
||||||
|
'#d62828',
|
||||||
|
'#023e8a',
|
||||||
|
'#0077b6',
|
||||||
|
'#0096c7',
|
||||||
|
'#00b4d8',
|
||||||
|
'#48cae4',
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
</html>
|
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
|
@ -1,19 +1,7 @@
|
||||||
<html>
|
{% extends 'single.html' %}
|
||||||
|
|
||||||
<head>
|
{% block content %}
|
||||||
|
|
||||||
<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>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--primary-color: #bc1f2d;
|
--primary-color: #bc1f2d;
|
||||||
|
|
@ -41,15 +29,7 @@
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<!-- <div class="hero bg-gray">
|
|
||||||
<div class="hero-body">
|
|
||||||
<h1>Pair your headset.</h1>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-image">
|
<div class="card-image">
|
||||||
|
|
@ -74,7 +54,7 @@
|
||||||
let submit_button = document.getElementById('submit_pairing_code');
|
let submit_button = document.getElementById('submit_pairing_code');
|
||||||
let pair_code_input = document.getElementById('pair_code');
|
let pair_code_input = document.getElementById('pair_code');
|
||||||
submit_button.addEventListener('click', () => {
|
submit_button.addEventListener('click', () => {
|
||||||
httpGetAsync('/api/pair_headset/' + pair_code_input.value, (resp) => {
|
httpGetAsync("{% include 'api_url.html' %}/api/pair_headset/" + pair_code_input.value, (resp) => {
|
||||||
console.log(resp);
|
console.log(resp);
|
||||||
let respData = JSON.parse(resp);
|
let respData = JSON.parse(resp);
|
||||||
if (respData['hw_id'] != '') {
|
if (respData['hw_id'] != '') {
|
||||||
|
|
@ -86,6 +66,4 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
{% endblock %}
|
||||||
|
|
||||||
</html>
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en-US">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title></title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="/static/css/spectre.min.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="/static/css/spectre-exp.min.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="/static/css/spectre-icons.min.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="/static/css/coloris.min.css">
|
||||||
|
<script src="/static/js/util.js"></script>
|
||||||
|
<style>
|
||||||
|
.container {
|
||||||
|
max-width: 30em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
margin: 1em;
|
||||||
|
box-shadow: 0 0 2em #0003;
|
||||||
|
}
|
||||||
|
|
||||||
|
input.btn {
|
||||||
|
cursor: auto;
|
||||||
|
user-select: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.centered {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
{% block content %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
@ -1,14 +1,6 @@
|
||||||
<html>
|
{% extends 'single.html' %}
|
||||||
|
|
||||||
<head>
|
{% block content %}
|
||||||
|
|
||||||
<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">
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
@ -24,12 +16,8 @@
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="centered">
|
<div class="centered">
|
||||||
🎉 SUCCESS 🎉
|
🎉 SUCCESS 🎉
|
||||||
</div>
|
</div>
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
{% endblock %}
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 charecters -->
|
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 charecters -->
|
||||||
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
|
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
|
||||||
|
<title>API Reference</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<rapi-doc
|
<rapi-doc
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,6 @@
|
||||||
<html>
|
---
|
||||||
|
title: "FAILURE"
|
||||||
<head>
|
---
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
|
|
||||||
<link rel="manifest" href="/favicons/site.webmanifest">
|
|
||||||
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#5bbad5">
|
|
||||||
<meta name="msapplication-TileColor" content="#b91d47">
|
|
||||||
<meta name="theme-color" content="#ffffff">
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
|
|
@ -24,12 +15,7 @@
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="centered">
|
<div class="centered">
|
||||||
🤮 FAIL 🤡
|
🤮 FAIL 🤡
|
||||||
</div>
|
</div>
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
|
|
@ -1,19 +1,6 @@
|
||||||
<html>
|
---
|
||||||
|
title: VEL Connect
|
||||||
<head>
|
---
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
|
|
||||||
<link rel="manifest" href="/favicons/site.webmanifest">
|
|
||||||
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#5bbad5">
|
|
||||||
<meta name="msapplication-TileColor" content="#b91d47">
|
|
||||||
<meta name="theme-color" content="#ffffff">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/spectre.min.css">
|
|
||||||
<script src="/js/util.js"></script>
|
|
||||||
<style>
|
<style>
|
||||||
.container {
|
.container {
|
||||||
max-width: 30em;
|
max-width: 30em;
|
||||||
|
|
@ -33,20 +20,15 @@
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
<div id="loading"><br><br><div class="loading loading-lg"></div></div>
|
||||||
<div class="container">
|
<div id="failure" style="display: none;"><br><br><br>☹️</div>
|
||||||
|
|
||||||
<div id="loading" class="loading loading-lg"></div>
|
|
||||||
<div id="failure" style="display: none;">☹️</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="headset_details" style="display: none;">
|
<div id="headset_details" style="display: none;">
|
||||||
<div class="panel card">
|
<div class="panel card">
|
||||||
<div class="panel-header text-center">
|
<div class="panel-header text-center">
|
||||||
<figure class="avatar avatar-lg"><img src="/favicons/android-chrome-192x192.png"
|
<figure class="avatar avatar-lg"><img src="/favicons/android-chrome-192x192.png" alt="Avatar"></figure>
|
||||||
alt="Avatar"></figure>
|
|
||||||
<div class="panel-title h5 mt-10">Headset Info</div>
|
<div class="panel-title h5 mt-10">Headset Info</div>
|
||||||
<div class="panel-subtitle hw_id">---</div>
|
<div class="panel-subtitle hw_id">---</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -101,7 +83,7 @@
|
||||||
<div class="tile tile-centered">
|
<div class="tile tile-centered">
|
||||||
<div class="tile-content">
|
<div class="tile-content">
|
||||||
<div class="tile-title text-bold">User Color</div>
|
<div class="tile-title text-bold">User Color</div>
|
||||||
<input class="btn user_color" type="color" id="user_color" placeholder="#ffffff">
|
<input class="btn user_color coloris" type="text" id="user_color" placeholder="#ffffff">
|
||||||
</div>
|
</div>
|
||||||
<div class="tile-action">
|
<div class="tile-action">
|
||||||
<button class="btn btn-primary btn-lg tooltip tooltip-left" id="set_user_color"
|
<button class="btn btn-primary btn-lg tooltip tooltip-left" id="set_user_color"
|
||||||
|
|
@ -112,7 +94,7 @@
|
||||||
<div class="tile tile-centered">
|
<div class="tile tile-centered">
|
||||||
<div class="tile-content">
|
<div class="tile-content">
|
||||||
<div class="tile-title text-bold">Carpet Color</div>
|
<div class="tile-title text-bold">Carpet Color</div>
|
||||||
<input class="btn carpet_color" type="color" id="carpet_color" placeholder="#ffffff">
|
<input class="btn carpet_color coloris" type="text" id="carpet_color" placeholder="#ffffff">
|
||||||
</div>
|
</div>
|
||||||
<div class="tile-action">
|
<div class="tile-action">
|
||||||
<button class="btn btn-primary btn-lg tooltip tooltip-left" id="set_carpet_color"
|
<button class="btn btn-primary btn-lg tooltip tooltip-left" id="set_carpet_color"
|
||||||
|
|
@ -124,8 +106,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<script type="text/javascript" src="/js/coloris.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
let submit_button = document.getElementById('submit_pairing_code');
|
let submit_button = document.getElementById('submit_pairing_code');
|
||||||
|
|
@ -141,7 +123,6 @@
|
||||||
|
|
||||||
// check cookie
|
// check cookie
|
||||||
let hw_id = getCookie('hw_id');
|
let hw_id = getCookie('hw_id');
|
||||||
loading.style.display = "none";
|
|
||||||
if (hw_id != "") {
|
if (hw_id != "") {
|
||||||
|
|
||||||
httpGetAsync('https://connect.vel.workers.dev/api/get_state/' + hw_id, (resp) => {
|
httpGetAsync('https://connect.vel.workers.dev/api/get_state/' + hw_id, (resp) => {
|
||||||
|
|
@ -159,8 +140,10 @@
|
||||||
writeValue('carpet_color', respData['room']['carpet_color']);
|
writeValue('carpet_color', respData['room']['carpet_color']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loading.style.display = "none";
|
||||||
headset_details.style.display = "block";
|
headset_details.style.display = "block";
|
||||||
}, (status) => {
|
}, (status) => {
|
||||||
|
loading.style.display = "none";
|
||||||
failure.style.display = "block";
|
failure.style.display = "block";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -204,7 +187,22 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
Coloris({
|
||||||
</body>
|
el: '.coloris',
|
||||||
|
swatches: [
|
||||||
|
'#264653',
|
||||||
|
'#2a9d8f',
|
||||||
|
'#e9c46a',
|
||||||
|
'#f4a261',
|
||||||
|
'#e76f51',
|
||||||
|
'#d62828',
|
||||||
|
'#023e8a',
|
||||||
|
'#0077b6',
|
||||||
|
'#0096c7',
|
||||||
|
'#00b4d8',
|
||||||
|
'#48cae4',
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
</html>
|
|
||||||
|
</script>
|
||||||
|
|
@ -1,19 +1,7 @@
|
||||||
<html>
|
---
|
||||||
|
title: "Pairing"
|
||||||
|
---
|
||||||
|
|
||||||
<head>
|
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
|
|
||||||
<link rel="manifest" href="/favicons/site.webmanifest">
|
|
||||||
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#5bbad5">
|
|
||||||
<meta name="msapplication-TileColor" content="#b91d47">
|
|
||||||
<meta name="theme-color" content="#ffffff">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/spectre.min.css">
|
|
||||||
<script src="/js/util.js"></script>
|
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--primary-color: #bc1f2d;
|
--primary-color: #bc1f2d;
|
||||||
|
|
@ -41,15 +29,7 @@
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<!-- <div class="hero bg-gray">
|
|
||||||
<div class="hero-body">
|
|
||||||
<h1>Pair your headset.</h1>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-image">
|
<div class="card-image">
|
||||||
|
|
@ -86,6 +66,3 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
|
|
@ -1,14 +1,6 @@
|
||||||
<html>
|
---
|
||||||
|
title: "SUCCESS"
|
||||||
<head>
|
---
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
|
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
|
|
||||||
<link rel="manifest" href="/favicons/site.webmanifest">
|
|
||||||
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#5bbad5">
|
|
||||||
<meta name="msapplication-TileColor" content="#b91d47">
|
|
||||||
<meta name="theme-color" content="#ffffff">
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
@ -24,12 +16,7 @@
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="centered">
|
<div class="centered">
|
||||||
🎉 SUCCESS 🎉
|
🎉 SUCCESS 🎉
|
||||||
</div>
|
</div>
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
{{ partial "head.html" (dict "title" .Title ) }}
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
{{ .Content }}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
<head>
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
|
||||||
|
<link rel="manifest" href="/favicons/site.webmanifest">
|
||||||
|
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#5bbad5">
|
||||||
|
<meta name="msapplication-TileColor" content="#b91d47">
|
||||||
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>{{ .title }}</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/css/spectre.min.css">
|
||||||
|
<link rel="stylesheet" href="/css/spectre-exp.min.css">
|
||||||
|
<link rel="stylesheet" href="/css/spectre-icons.min.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="/css/coloris.min.css">
|
||||||
|
<script src="/js/util.js"></script>
|
||||||
|
<style>
|
||||||
|
.container {
|
||||||
|
max-width: 30em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
margin: 1em;
|
||||||
|
box-shadow: 0 0 2em #0003;
|
||||||
|
}
|
||||||
|
|
||||||
|
input.btn {
|
||||||
|
cursor: auto;
|
||||||
|
user-select: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.centered {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue