diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/html/index.html | 2 | ||||
-rw-r--r-- | data/js/birdscan.js | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/data/html/index.html b/data/html/index.html index 268aad9..002f50a 100644 --- a/data/html/index.html +++ b/data/html/index.html @@ -27,6 +27,8 @@ <p>A software to take beautiful pictures of birds with a Raspberry Pi Camera.</p> <p id="state"></p> <button onclick="singlePicture()">Take single picture</button> + <button onclick="reboot()">reboot</button> + <button onclick="poweroff()">poweroff</button> </main> <script src="./js/birdscan.js"></script> diff --git a/data/js/birdscan.js b/data/js/birdscan.js index d3a46c3..87ec3e7 100644 --- a/data/js/birdscan.js +++ b/data/js/birdscan.js @@ -8,6 +8,18 @@ function singlePicture() { xhttp.send(); } +function poweroff() { + const xhttp = new XMLHttpRequest(); + xhttp.open("POST", "./api/poweroff", true); + xhttp.send(); +} + +function reboot() { + const xhttp = new XMLHttpRequest(); + xhttp.open("POST", "./api/reboot", true); + xhttp.send(); +} + function updateState() { if (!updateStatePending) { updateStatePending = true; |