diff options
Diffstat (limited to 'templates/admin/testexp.html')
-rw-r--r-- | templates/admin/testexp.html | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/templates/admin/testexp.html b/templates/admin/testexp.html index 807e0f2..e3388f5 100644 --- a/templates/admin/testexp.html +++ b/templates/admin/testexp.html @@ -15,7 +15,7 @@ } #log-data > span { word-spacing: 5em; - margin-left: 3em; + margin-left: 3em; } </style> <div class="container"> @@ -45,6 +45,7 @@ </tbody> </table> </div> + <!-- Modal code starts here --> <div class="modal hide fade" id="test-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> @@ -89,10 +90,11 @@ </div> </div> <!-- Modal code ends here --> + </div> </div> <script> -var BASE_URL = window.location.origin + "/sbhs-rpi"; + var BASE_URL = window.location.origin + "/sbhs"; $("#tableId").on("click", "tr", function(e) { $("#tableId").find("tr.highlight").removeClass("highlight"); $(this).addClass("highlight"); @@ -102,8 +104,8 @@ var BASE_URL = window.location.origin + "/sbhs-rpi"; if (isSelectedMachineVacant) { $("#temp").val(""); - $("#heater-val").val(""); $("#fan-val").val(""); + $("#heater-val").val(""); $("#test-modal").modal(); } else { @@ -185,6 +187,7 @@ var BASE_URL = window.location.origin + "/sbhs-rpi"; function getTemp() { var selected_machine = document.getElementsByClassName("highlight"); + console.log('Inside getTemp function'); if (selected_machine.length == 0) { alert("Please select a machine first"); return; @@ -192,7 +195,7 @@ var BASE_URL = window.location.origin + "/sbhs-rpi"; var selected_mid = selected_machine[0].getElementsByTagName('td')[0].innerHTML; $(".btn").prop('disabled',true); - + console.log('mid'+selected_mid); var request = $.ajax({ url : BASE_URL + '/admin/gettemp', method : 'POST', @@ -200,8 +203,9 @@ var BASE_URL = window.location.origin + "/sbhs-rpi"; 'mid' : selected_mid } }); - + //console.log('mid'+mid) request.done(function(data){ + console.log('data.status_code',data.status_code); if (data.status_code == 200) { document.getElementById("temp").value = data.message; } @@ -240,6 +244,7 @@ var BASE_URL = window.location.origin + "/sbhs-rpi"; document.getElementById("log-data").innerHTML = "<pre>Iteration Heater Fan Temp</pre><span>" + data.message.logs.replace(new RegExp("\n","g"), "</span><br/><span>") + "</span>"; } else { + console.log(data.message); alert(data.message); } $(".btn").prop('disabled',false); |