poweroff.html 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <html>
  2. <head>
  3. <title>Host Power Options</title>
  4. <style>
  5. </style>
  6. </head>
  7. <body>
  8. <div class="ui container">
  9. <div class="ui basic segment">
  10. <h3 class="ui header">
  11. <i class="power icon"></i>
  12. <div class="content">
  13. Host Power
  14. <div class="sub header">Change power state of your device</div>
  15. </div>
  16. </h3>
  17. </div>
  18. <div class="ui divider"></div>
  19. <div class="ui segment">
  20. <h3 class="ui header">
  21. <i class="green check circle icon"></i>
  22. <div class="content">
  23. System Online
  24. <div class="sub header">Last update: <span id="lastupdateTime"></span></div>
  25. </div>
  26. </h3>
  27. </div>
  28. <div class="ui divider"></div>
  29. <p>Power Options</p>
  30. <button class="ui red button" onclick="shutdown();"><i class="power off icon"></i> Power Off</button>
  31. <button class="ui yellow button" onclick="restart();"><i class="refresh icon"></i> Restart</button>
  32. <div class="ui icon yellow message">
  33. <i class="yellow exclamation circle icon"></i>
  34. <div class="content">
  35. <div class="header">
  36. Restart / Shutdown is risky
  37. </div>
  38. <p>Normally, Linux based server don't require reboot. If you decided to shutdown your host server, ArozOS will pass the shutdown sequence to the host operating system and there is no way to know from the web interface if the shutdown / restart process has completed. <br>
  39. <b>Please make sure you are shutting it down in a place where you can physcically power on the host again.</b></p>
  40. </div>
  41. </div>
  42. </div>
  43. <script>
  44. $("#lastupdateTime").text(ao_module_utils.timeConverter(Date.now()/1000));
  45. function shutdown(){
  46. }
  47. function restart(){
  48. var apiObject = {
  49. api: "system/power/restart",
  50. data: {},
  51. title: "Restart Host",
  52. desc: "Authentication is required in order to proceed the restart process",
  53. thisuser: true, //This username as default, set to false for entering other user
  54. method: "GET"
  55. }
  56. apiObject = encodeURIComponent(JSON.stringify(apiObject));
  57. ao_module_newfw({
  58. url: "SystemAO/security/authreq.html#" + apiObject,
  59. width: 380,
  60. height: 200,
  61. appicon: "SystemAO/security/img/lock.svg",
  62. title: "Restart - Authentication Required"
  63. });
  64. }
  65. </script>
  66. </body>
  67. </html>