diff options
author | dk-15 | 2017-05-22 16:57:42 +0530 |
---|---|---|
committer | dk-15 | 2017-05-22 16:57:42 +0530 |
commit | fb6c70cf1e053688002df3cca4ff0cec8deb8b38 (patch) | |
tree | 45c57effbe21048a9766ef6ba8fd25731692ff0d /templates/admin/testexp.html | |
parent | 187752f92a1aaed0408a20e8e40b9d1b82b69847 (diff) | |
download | SBHS-2018-Rpi-fb6c70cf1e053688002df3cca4ff0cec8deb8b38.tar.gz SBHS-2018-Rpi-fb6c70cf1e053688002df3cca4ff0cec8deb8b38.tar.bz2 SBHS-2018-Rpi-fb6c70cf1e053688002df3cca4ff0cec8deb8b38.zip |
Admin testing platform in working condition
Diffstat (limited to 'templates/admin/testexp.html')
-rw-r--r-- | templates/admin/testexp.html | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/templates/admin/testexp.html b/templates/admin/testexp.html index fa45cd7..aac5657 100644 --- a/templates/admin/testexp.html +++ b/templates/admin/testexp.html @@ -27,9 +27,9 @@ </tbody> </table> </div> - <div class="span5"> + <div class="span5" style="position: fixed;right: 10%; border: 1px slategray solid; padding: 15px;"> <div> - <input type="text" id="temp"><br/> + <input type="text" id="temp" disabled="true"><br/> <button class="btn btn-primary" onclick="getTemp()">Get Temperature</button> </div> <br><br> @@ -80,9 +80,11 @@ request.done(function(data){ if (data.status_code == 200) { document.getElementById("temp").value = data.message; + document.getElementById("fan_val").value = 100; + document.getElementById("heater_val").value = 0; } else { - alert("Some error occured. Please try again!!"); + alert(data.message); } }); } @@ -100,6 +102,7 @@ var isInputOK = !isNaN(fan_value) && fan_value >=0 && fan_value <= 250 && !isNaN(heater_value) && heater_value >=0 && heater_value; if (!isInputOK) { alert("Please enter a value between 0 and 250"); + return; } var request = $.ajax({ @@ -117,11 +120,11 @@ document.getElementById("temp").value = data.message; } else { - alert("Some error occured. Please try again!!"); + alert(data.message); } }); } - + var mydata; function getTemp() { var selected_machine = document.getElementsByClassName("highlight"); if (selected_machine.length == 0) { @@ -138,11 +141,12 @@ }); request.done(function(data){ + mydata = data; if (data.status_code == 200) { document.getElementById("temp").value = data.message; } else { - alert("Some error occured. Please try again!!"); + alert(data.message); } }); } |