summaryrefslogtreecommitdiff
path: root/templates/admin/testexp.html
diff options
context:
space:
mode:
authordk-152017-05-26 03:06:14 +0530
committerdk-152017-05-26 03:09:12 +0530
commit62e55de6d432edf52e60a2b562e160b74508f256 (patch)
tree5d19a16927a68ada35b4617eb79650c5253b9755 /templates/admin/testexp.html
parent6ef013505cd0f28a2ae4a98948fb1913e7f2898c (diff)
downloadSBHS-2018-Rpi-62e55de6d432edf52e60a2b562e160b74508f256.tar.gz
SBHS-2018-Rpi-62e55de6d432edf52e60a2b562e160b74508f256.tar.bz2
SBHS-2018-Rpi-62e55de6d432edf52e60a2b562e160b74508f256.zip
Add features and fix bugs
- Fix sorting bug in bookings - Prevent admin access during ongoing experiment - Fix trashable bug in slot deletion - Show only online machines in test boards
Diffstat (limited to 'templates/admin/testexp.html')
-rw-r--r--templates/admin/testexp.html37
1 files changed, 31 insertions, 6 deletions
diff --git a/templates/admin/testexp.html b/templates/admin/testexp.html
index 880f081..39291fa 100644
--- a/templates/admin/testexp.html
+++ b/templates/admin/testexp.html
@@ -2,6 +2,18 @@
{% load staticfiles %}
{% block content %}
+<style type="text/css">
+ .highlight {
+ background-color: lightblue;
+ }
+ #test-device, #monitor-logs {
+ position: fixed;
+ right: 10%;
+ border: 1px slategray solid;
+ padding: 15px;
+ display: none;
+ }
+</style>
<div class="container">
<div class="row">
{% include "account/sub_nav.html" %}
@@ -15,6 +27,7 @@
<tr>
<th>Board MID</th>
<th>Status</th>
+ <th>Occupied</th>
</tr>
</thead>
<tbody>
@@ -22,12 +35,13 @@
<tr>
<td>{{ b.mid }}</td>
<td><span class="label label-{% if b.online %}success{% else %}important{% endif %}">{% if b.online %}Online{% else %}Offline{% endif %}</span></td>
+ <td><span class="label label-{% if b.mid in mids %}important{% else %}success{% endif %}">{% if b.mid in mids %}Ongoing{% else %}Vacant{% endif %}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
- <div class="span5" style="position: fixed;right: 10%; border: 1px slategray solid; padding: 15px;">
+ <div id="test-device" class="span5">
<div>
<input type="text" id="temp" disabled="true"><br/>
<button class="btn btn-primary" onclick="getTemp()">Get Temperature</button>
@@ -48,18 +62,29 @@
</div>
+ <div class="span5" id="monitor-logs">
+ <span>chal raha hain bhai</span>
+ </div>
+
</div>
</div>
-<style type="text/css">
- .highlight {
- background-color: lightblue;
- }
-</style>
<script>
var BASE_URL = window.location.origin;
$("#tableId").on("click", "tr", function(e) {
$("#tableId").find("tr.highlight").removeClass("highlight");
$(this).addClass("highlight");
+
+ columns = e.currentTarget.getElementsByTagName("td");
+ isSelectedMachineVacant = columns[columns.length-1].childNodes[0].className.indexOf("label-success") > -1
+
+ if (isSelectedMachineVacant) {
+ $("#test-device").show();
+ $("#monitor-logs").hide();
+ }
+ else {
+ $("#monitor-logs").show();
+ $("#test-device").hide();
+ }
});
function resetParams() {