shutdown.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <html>
  2. <head>
  3. <title>Shutting Down</title>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=no">
  6. <script type="text/javascript" src="../../script/jquery.min.js"></script>
  7. <style>
  8. body{
  9. background-color: #0f0f0f;
  10. }
  11. .main{
  12. width: 400px;
  13. height: 100px;
  14. padding: 20px;
  15. position: absolute;
  16. top: 30%;
  17. left: calc(50% - 200px);
  18. color: white;
  19. font-family: monospace;
  20. text-align: center;
  21. }
  22. .brandicon{
  23. width: 70%;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <br><br><br>
  29. <div class="main">
  30. <img class="brandicon" src="../../img/vendor/vendor_icon.png">
  31. <p id="countdown">Host server is shutting down in 60 seconds</p>
  32. </div>
  33. <script>
  34. //ArozOS default shutdown after 60 seconds after shutdown request has been made.
  35. //Shut it down
  36. let counter = 60;
  37. function handleCountdown(){
  38. setTimeout(function(){
  39. counter--;
  40. if (counter == 0){
  41. setTimeout(function(){
  42. $.ajax({
  43. url: "../../system/auth/checkLogin",
  44. success: function(data){
  45. $("#countdown").text("Shutdown failed. Please try again later");
  46. document.title = "Shutdown Failed";
  47. },
  48. error: function(){
  49. //Server connection lost. Should have been shutted down
  50. $("#countdown").text("Shutdown Succeed: Host offline");
  51. document.title = "Offline";
  52. },
  53. timeout: 2000
  54. });
  55. }, 3000);
  56. $("#countdown").text("Checking Connection State...");
  57. }else{
  58. $("#countdown").text(`Host server is shutting down in ${counter} seconds`);
  59. handleCountdown();
  60. }
  61. }, 1000);
  62. }
  63. handleCountdown();
  64. </script>
  65. </body>
  66. </html>