From b8e6e8474ba42509445933bf033e4e6c4981eb73 Mon Sep 17 00:00:00 2001
From: coderick14
Date: Fri, 26 May 2017 17:34:54 +0530
Subject: Add admin monitoring feature
---
templates/admin/testexp.html | 43 ++++++++++++++++++++++++++++++++++++++++---
1 file changed, 40 insertions(+), 3 deletions(-)
(limited to 'templates/admin')
diff --git a/templates/admin/testexp.html b/templates/admin/testexp.html
index 39291fa..052cfe9 100644
--- a/templates/admin/testexp.html
+++ b/templates/admin/testexp.html
@@ -63,7 +63,9 @@
-
chal raha hain bhai
+
+
+
@@ -150,7 +152,7 @@
}
});
}
- var mydata;
+
function getTemp() {
var selected_machine = document.getElementsByClassName("highlight");
if (selected_machine.length == 0) {
@@ -167,7 +169,6 @@
});
request.done(function(data){
- mydata = data;
if (data.status_code == 200) {
document.getElementById("temp").value = data.message;
}
@@ -176,6 +177,42 @@
}
});
}
+
+ function getLogs() {
+ var selected_machine = document.getElementsByClassName("highlight");
+ if (selected_machine.length == 0) {
+ alert("Please select a machine first");
+ return;
+ }
+ var selected_mid = selected_machine[0].getElementsByTagName('td')[0].innerHTML;
+ var request = $.ajax({
+ url : BASE_URL + '/admin/monitor',
+ method : 'POST',
+ data : {
+ 'mid' : selected_mid
+ }
+ });
+
+ header = "Time | Fan | Heat | Temp | "
+ request.done(function(data){
+ if (data.status_code == 200) {
+ console.log(data.message.logs.replace("/\n/g", "
"));
+ document.getElementById("username").innerHTML = "User : " + data.message.user;
+ document.getElementById("log-data").innerHTML = "Date Time Heater Fan Temp
" + data.message.logs.replace(new RegExp("\n","g"), "
");
+ }
+ else {
+ alert(data.status_code);
+ }
+ });
+ }
+
+ // update status of ongoing experiments
+ setInterval(function() {
+ var now = new Date();
+ if (now.getMinutes() == 56 || now.getMinutes() == 1) {
+ location.reload();
+ }
+ }, 60000);
{% endblock %}
--
cgit
From 9ad308de090c3db0e91d853afe861f5d9b828a8d Mon Sep 17 00:00:00 2001
From: coderick14
Date: Fri, 26 May 2017 18:04:57 +0530
Subject: Add download logs feature for admin
---
templates/admin/index.html | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'templates/admin')
diff --git a/templates/admin/index.html b/templates/admin/index.html
index 95956f5..3e9ce15 100644
--- a/templates/admin/index.html
+++ b/templates/admin/index.html
@@ -15,6 +15,8 @@
Board MID |
Status |
Webcam |
+ Temperature Profile |
+ Download Logs |
@@ -23,7 +25,8 @@
{{ b.mid }} |
{% if b.online %}Online{% else %}Offline{% endif %} |
View image |
- View temperature profile |
+ View |
+ Download |
{% endfor %}
--
cgit