Skip to content

Commit 1232f95

Browse files
committed
Finalise the firmware dashboard template
Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
1 parent 79f8104 commit 1232f95

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

server/django/sensordata/templates/firmware_dashboard.html

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
{% extends 'base.html' %}
22
{% block content %}
33
<div class="container mt-4">
4-
<h2>Firmware Update Dashboard</h2>
5-
4+
<a href="{% url 'admin:sensordata_firmware_add' %}" class="btn btn-primary mb-3">Add New Firmware</a>
65
<form method="post" id="firmware-update-form">
76
{% csrf_token %}
8-
9-
<div class="form-group"></div>
7+
<div class="form-group">
108
<label for="firmware_id">Select Firmware to Update:</label>
11-
<select name="firmware_id" class="form-control" required>
9+
<select name="firmware_id" id="firmware_id" class="form-control" required>
1210
{% for version in firmware_versions %}
1311
<option value="{{ version }}">{{ version }}</option>
1412
{% endfor %}
1513
</select>
1614
</div>
1715
<button type="submit" class="btn btn-success" id="update-firmware-btn">Update Firmware for Selected
1816
Devices</button>
19-
2017
<br><br>
21-
2218
<table class="table table-bordered">
2319
<thead>
2420
<tr>
@@ -37,7 +33,6 @@ <h2>Firmware Update Dashboard</h2>
3733
{% endfor %}
3834
</tbody>
3935
</table>
40-
4136
</form>
4237

4338
<!-- Ongoing Firmware Updates -->
@@ -88,16 +83,13 @@ <h5 class="modal-title" id="updateModalLabel">Firmware Update</h5>
8883
<script>
8984
document.getElementById('firmware-update-form').addEventListener('submit', function (event) {
9085
event.preventDefault(); // Prevent the form from submitting
91-
9286
var checkboxes = document.querySelectorAll('input[name="device_ids"]:checked');
9387
if (checkboxes.length === 0) {
9488
alert("Please select at least one device.");
9589
return;
9690
}
97-
9891
// Show the pop-up
9992
$('#updateModal').modal('show');
100-
10193
});
10294
</script>
10395
{% endblock %}

0 commit comments

Comments
 (0)