dotest.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE html>
  2. <meta name="apple-mobile-web-app-capable" content="yes" />
  3. <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=0.6, maximum-scale=0.6" />
  4. <html>
  5. <head>
  6. <meta charset="UTF-8">
  7. <script type='text/javascript' charset='utf-8'>
  8. // Hides mobile browser's address bar when page is done loading.
  9. window.addEventListener('load', function(e) {
  10. setTimeout(function() {
  11. window.scrollTo(0, 1);
  12. }, 1);
  13. }, false);
  14. </script>
  15. <title>ArOZ Onlineβ</title>
  16. <link rel="stylesheet" href="../../../script/tocas/tocas.css">
  17. <script src="../../../script/tocas/tocas.js"></script>
  18. <script src="../../../script/jquery.min.js"></script>
  19. <!--<script src="../../../script/ao_module.js"></script>-->
  20. </head>
  21. <body style="background-color: rgba(255, 255, 255,0.9)">
  22. <br>
  23. <div class="ts container">
  24. <p id="Tstatus">Quick diagnostic in progress... Approximate time was 3 minutes.</p>
  25. <div class="ts progress">
  26. <div class="bar" id="prbar" style="width: 0%"></div>
  27. </div>
  28. <p id="status"></p>
  29. </div>
  30. <script>
  31. var timer = setInterval(function() {
  32. $.getJSON("../../../system/disk/smart/getLogInfo?disk=" + get("disk"), function(data) {
  33. if (data["value"] == 246) {
  34. var width = data["remaining_percent"];
  35. $("#prbar").attr("style", "width: " + (100 - width) + "%");
  36. $("#status").text("Status:" + data["string"]);
  37. } else if (data["value"] == 16) {
  38. $("#Tstatus").text("Harddisk test aborted.");
  39. $("#status").text("Status:" + data["string"]);
  40. } else if (data["value"] == 0) {
  41. $("#Tstatus").text("Harddisk test finished.");
  42. $("#prbar").attr("style", "width: 100%");
  43. $("#status").text("Status:" + data["string"]);
  44. }
  45. });
  46. }, 3000);
  47. //https://stackoverflow.com/questions/831030/how-to-get-get-request-parameters-in-javascript
  48. function get(name) {
  49. if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search)) {
  50. return decodeURIComponent(name[1]);
  51. }
  52. }
  53. </script>
  54. </body>
  55. </html>
  56. <?php
  57. exec('sudo smartctl -t short -C '.$_GET["disk"]);
  58. ?>