Skip to content

Commit

Permalink
add second confirm for reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronwmorris committed Aug 21, 2023
1 parent d57fc83 commit 235deb9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions indi_allsky/flask/templates/system.html
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,14 @@
<div class="col-sm-2"></div>
<div class="col-sm-2">Reboot</div>
<div class="col-sm-2">
<input class="form-check-input" id="REBOOT_CONFIRM" name="REBOOT_CONFIRM" type="checkbox" value="y"> Confirm
<input class="form-check-input" id="REBOOT_CONFIRM1" name="REBOOT_CONFIRM1" type="checkbox" value="y"> Confirm 1
</div>
<div class="col-sm-2">
<button class="btn btn-warning" id="button_system_reboot">Reboot system</button>
</div>
<div class="col-sm-2">
<input class="form-check-input" id="REBOOT_CONFIRM2" name="REBOOT_CONFIRM2" type="checkbox" value="y"> Confirm 2
</div>
</div>

<hr />
Expand Down Expand Up @@ -822,7 +825,12 @@


$("#button_system_reboot").on("click", function() {
if (! $("#REBOOT_CONFIRM").prop('checked')) {
if (! $("#REBOOT_CONFIRM1").prop('checked')) {
console.log('Reboot checkbox not checked');
return;
}

if (! $("#REBOOT_CONFIRM2").prop('checked')) {
console.log('Reboot checkbox not checked');
return;
}
Expand All @@ -831,7 +839,8 @@
$("#button_system_reboot").prop('disabled', true);
$("#button_system_shutdown").prop('disabled', true);

$("#REBOOT_CONFIRM").prop('checked', false);
$("#REBOOT_CONFIRM1").prop('checked', false);
$("#REBOOT_CONFIRM2").prop('checked', false);

button_click('system', 'reboot');
});
Expand Down

0 comments on commit 235deb9

Please sign in to comment.