You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- allowing user to shutdown password-less within 5 minutes since last authentication 🛂
- design and dynamic content things 👍
- ask for confirmation on cancel of shutdown events
- check shutdown regularly with update of dashboard
- rewrote checkShutdown routine
- mdtoastJS: library 😆 applying duration to toasts with interaction not only for those without action button
document.getElementById("currentState").innerHTML='<div class="alert alert-info" role="alert"><i data-feather="chevrons-right"></i> Checking for power events...</div>';
553
569
var xmlhttp = new XMLHttpRequest();
554
570
xmlhttp.onreadystatechange = function() {
555
571
if (this.readyState == 4 && this.status == 200) {
556
572
if(this.responseText==""){
557
573
document.getElementById("sys2").innerHTML="";
558
574
shutdownCurrent=false;
559
-
return;
575
+
}else{
576
+
shutdownCurrent=true;
577
+
outputShutdown(this.responseText,"unknown");
578
+
}
579
+
if(callback !== undefined){
580
+
callback();
581
+
}else{
582
+
if(shutdownCurrent){
583
+
document.getElementById("currentState").innerHTML='<div class="alert alert-danger" role="alert"><i data-feather="alert-circle"></i> Existing shutdown will be overwritten. <button class="btn btn-sm btn-outline-danger" onclick="cancelShutdown();$(\'#exampleModalCenter\').modal(\'hide\');">Remove</button></div>';
584
+
}else{
585
+
document.getElementById("currentState").innerHTML='<div class="alert alert-success" role="alert"><i data-feather="check-circle"></i> Currently there is no other power event planned.</div>';
@@ -928,13 +984,15 @@ function addWarning(problem, icon){
928
984
}
929
985
930
986
$('#exampleModalCenter').on('shown.bs.modal', function (e) {
931
-
checkShutdown();
932
-
if(shutdownCurrent){
933
-
document.getElementById("currentState").innerHTML='<div class="alert alert-danger" role="alert"><i data-feather="alert-circle"></i> Existing shutdown will be overwritten. <button class="btn btn-sm btn-outline-danger" onclick="cancelShutdown();$(\'#exampleModalCenter\').modal(\'hide\');">Remove</button></div>';
934
-
}else{
935
-
document.getElementById("currentState").innerHTML='<div class="alert alert-success" role="alert"><i data-feather="check-circle"></i> Currently there is no other power event planned.</div>';
936
-
}
937
-
feather.replace();
987
+
checkShutdown(function(){
988
+
if(shutdownCurrent){
989
+
document.getElementById("currentState").innerHTML='<div class="alert alert-danger" role="alert"><i data-feather="alert-circle"></i> Existing shutdown will be overwritten. <button class="btn btn-sm btn-outline-danger" onclick="cancelShutdown();$(\'#exampleModalCenter\').modal(\'hide\');">Remove</button></div>';
990
+
}else{
991
+
document.getElementById("currentState").innerHTML='<div class="alert alert-success" role="alert"><i data-feather="check-circle"></i> Currently there is no other power event planned.</div>';
0 commit comments