From 5643b52829587c6bc723233a14b2bdc3f52b3879 Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 18 Jun 2021 16:03:17 +0200 Subject: Implement reboot and poweroff via Web Interface --- data/js/birdscan.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'data/js') 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; -- cgit v1.2.3-70-g09d2