updating.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>System Update</title>
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=no">
  7. <link rel="stylesheet" href="../../script/semantic/semantic.min.css">
  8. <script type="text/javascript" src="../../script/jquery.min.js"></script>
  9. <script type="text/javascript" src="../../script/semantic/semantic.min.js"></script>
  10. <script type="text/javascript" src="../../script/ao_module.js"></script>
  11. <style>
  12. body{
  13. background-color: #1c1c1c;
  14. }
  15. #panel {
  16. display: flex;
  17. justify-content: center;
  18. align-items: center;
  19. text-align: center;
  20. min-height: 100vh;
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. <div id="panel" style="text-align: left;">
  26. <div id="pinging" class="ui message">
  27. <div class="header" >
  28. <i class="ui loading spinner icon"></i> Performing System Updates
  29. </div>
  30. <p>The updates might take a few minutes depending on your disk IO and CPU speed. This page will refresh itself after the update completes.</p>
  31. <p>Last Ping: <span id="pingTime"></span></p>
  32. <div class="ui divider"></div>
  33. <p><i class="info icon"></i> Do you know you can write your own launcher / updater for ArozOS by using some simple code of your own?</p>
  34. </div>
  35. <div id="succ" class="ui green message" style="min-width: 30vw; display:none;">
  36. <div class="header">
  37. <i class="ui green big checkmark icon"></i> Update Completed
  38. </div>
  39. <p>Redirecting to homepage in 3 seconds.<br> If it doesn't work, click <a href="../../">here</a></p>
  40. </div>
  41. </div>
  42. <script>
  43. //Delay 1 sec and start update process
  44. setTimeout(function(){
  45. $("#pingTime").text("READY!");
  46. UpdateRestartArozOS();
  47. }, 1000)
  48. function UpdateRestartArozOS(){
  49. $.ajax({
  50. url: "/system/update/restart",
  51. method: "POST",
  52. data: {exec: true},
  53. success: function(data){
  54. //This wont succ
  55. }
  56. });
  57. setTimeout(function(){
  58. pingServer();
  59. }, 1000);
  60. }
  61. function pingServer(){
  62. $.ajax({
  63. url: "../../system/auth/checkLogin",
  64. error: function(){
  65. //Not started up yet, ping again 3 sec later
  66. setTimeout(function(){
  67. pingServer();
  68. }, 3000);
  69. $("#pingTime").text(new Date().toLocaleString(undefined, {year: 'numeric', month: '2-digit', day: '2-digit', weekday:"long", hour: '2-digit', hour12: false, minute:'2-digit', second:'2-digit'}));
  70. },
  71. success: function(){
  72. //Server started up again. Redirect back to index
  73. $("#pinging").slideUp("fast");
  74. $("#succ").slideDown("fast");
  75. setTimeout(function(){
  76. window.location.href = "../../";
  77. }, 3200);
  78. },
  79. timeout: 1000
  80. })
  81. }
  82. </script>
  83. </body>