|
|
@ -19,11 +19,9 @@
|
|
|
|
<html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<head>
|
|
|
|
<title>Connected Coffee Cup</title>
|
|
|
|
<title>Connected Coffee Cup</title>
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="css/coffee.css">
|
|
|
|
<link rel="stylesheet" href="css/coffee.css">
|
|
|
|
|
|
|
|
|
|
|
|
<!--[if lt IE 9]>
|
|
|
|
<!--[if lt IE 9]>
|
|
|
|
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
|
|
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
|
|
<![endif]-->
|
|
|
|
<![endif]-->
|
|
|
|
</head>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
|
@ -48,7 +46,6 @@
|
|
|
|
if (token != null) {
|
|
|
|
if (token != null) {
|
|
|
|
request.getSession().setAttribute("token", token);
|
|
|
|
request.getSession().setAttribute("token", token);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
%>
|
|
|
|
%>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
<div class="container">
|
|
|
@ -100,22 +97,19 @@
|
|
|
|
<script src="js/libs/htmlpreview.min.js"></script>
|
|
|
|
<script src="js/libs/htmlpreview.min.js"></script>
|
|
|
|
<script>HTMLPreview.replaceAssets();</script>
|
|
|
|
<script>HTMLPreview.replaceAssets();</script>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
$("#order-cup").click(function () {
|
|
|
|
$('#order-cup').click(function () {
|
|
|
|
|
|
|
|
|
|
|
|
var deviceId = '<%=request.getSession().getAttribute("deviceId")%>';
|
|
|
|
var deviceId = '<%=request.getSession().getAttribute("deviceId")%>';
|
|
|
|
var deviceOwner = '<%=request.getSession().getAttribute("deviceOwner")%>';
|
|
|
|
var deviceOwner = '<%=request.getSession().getAttribute("deviceOwner")%>';
|
|
|
|
var token = '<%=request.getSession().getAttribute("token")%>';
|
|
|
|
var token = '<%=request.getSession().getAttribute("token")%>';
|
|
|
|
var url = "/connectedcup/controller/ordercoffee?deviceId=" + deviceId + "&deviceOwner=" + deviceOwner;
|
|
|
|
var url = '/connectedcup/controller/ordercoffee?deviceId=' + deviceId + '&deviceOwner=' + deviceOwner;
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
type: 'POST',
|
|
|
|
type: 'POST',
|
|
|
|
url: url,
|
|
|
|
url: url,
|
|
|
|
headers: {
|
|
|
|
headers: {
|
|
|
|
"Authorization": "Bearer " + token
|
|
|
|
'Authorization': 'Bearer ' + token
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function sendData() {
|
|
|
|
function sendData() {
|
|
|
@ -123,19 +117,18 @@
|
|
|
|
var deviceOwner = '<%=request.getSession().getAttribute("deviceOwner")%>';
|
|
|
|
var deviceOwner = '<%=request.getSession().getAttribute("deviceOwner")%>';
|
|
|
|
var tenantDomain = '<%=request.getSession().getAttribute("tenantDomain")%>';
|
|
|
|
var tenantDomain = '<%=request.getSession().getAttribute("tenantDomain")%>';
|
|
|
|
if (tenantDomain == null) {
|
|
|
|
if (tenantDomain == null) {
|
|
|
|
tenantDomain = "carbon.super";
|
|
|
|
tenantDomain = 'carbon.super';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var tempPayload = temperature;
|
|
|
|
var tempPayload = temperature;
|
|
|
|
var levelPayload = coffee_amount;
|
|
|
|
var levelPayload = coffee_amount;
|
|
|
|
$.post("/connected-cup-agent/push_temperature?deviceId=" + deviceId + "&deviceOwner=" + deviceOwner +
|
|
|
|
$.post('/connected-cup-agent/push_temperature?deviceId=' + deviceId + '&deviceOwner=' + deviceOwner +
|
|
|
|
"&payload=" + tempPayload + "&tenantDomain=" + tenantDomain );
|
|
|
|
'&payload=' + tempPayload + '&tenantDomain=' + tenantDomain);
|
|
|
|
$.post("/connected-cup-agent/push_level?deviceId=" + deviceId + "&deviceOwner=" + deviceOwner +
|
|
|
|
$.post('/connected-cup-agent/push_level?deviceId=' + deviceId + '&deviceOwner=' + deviceOwner +
|
|
|
|
"&payload=" + levelPayload + "&tenantDomain=" + tenantDomain);
|
|
|
|
'&payload=' + levelPayload + '&tenantDomain=' + tenantDomain);
|
|
|
|
setTimeout(sendData, 5000);
|
|
|
|
setTimeout(sendData, 5000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sendData();
|
|
|
|
sendData();
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
</html>
|