mqtt test fin
This commit is contained in:
@@ -80,8 +80,9 @@
|
|||||||
fetch('/unsecure/esp/toggle-machine', { method: 'POST' })
|
fetch('/unsecure/esp/toggle-machine', { method: 'POST' })
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
console.log(data);
|
//console.log(data);
|
||||||
if (data.command === 'machineToggle') {
|
const inner = JSON.parse(data.status);
|
||||||
|
if (inner.command === 'machineToggle') {
|
||||||
document.getElementById("machine-status").innerText = "PENDING";
|
document.getElementById("machine-status").innerText = "PENDING";
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("machine-status").innerText = "SOME_ERR";
|
document.getElementById("machine-status").innerText = "SOME_ERR";
|
||||||
|
|||||||
Reference in New Issue
Block a user