index.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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() { window.scrollTo(0, 1); }, 1);
  11. }, false);
  12. </script>
  13. <title>ArOZ Onlineβ</title>
  14. <link rel="stylesheet" href="../../../script/tocas/tocas.css">
  15. <script src="../../../script/tocas/tocas.js"></script>
  16. <script src="../../../script/jquery.min.js"></script>
  17. </head>
  18. <body style="background-color: rgb(247, 247, 247);">
  19. <div class="ts container">
  20. <br>
  21. <div class="ts segment">
  22. <div class="ts header">
  23. Timezone configuration
  24. <div class="sub header">You could change the timezone.</div>
  25. </div>
  26. </div>
  27. <div class="ts divider"></div>
  28. <div class="ts segment">
  29. <div class="ts divided items">
  30. <div class="ts form">
  31. <div class="field">
  32. <label>Change timezone</label>
  33. <select id="tz">
  34. </select>
  35. </div>
  36. <!--
  37. <div class="field">
  38. <label>Change NTP Server</label>
  39. <input type="text" placeholder="pool.ntp.org">
  40. </div>
  41. -->
  42. <div class="field">
  43. <button class="ts button" onclick="changetimezone()">Apply</button>
  44. </div>
  45. </div>
  46. <p>
  47. The system synchronizes to NTP server. Therefore you can't change the time.
  48. </p>
  49. </div>
  50. </div>
  51. <br><br><br>
  52. </div>
  53. </div>
  54. <div class="ts bottom right snackbar">
  55. <div class="content"></div>
  56. </div>
  57. <script>
  58. var computerTZ = Intl.DateTimeFormat().resolvedOptions().timeZone;
  59. var serverTZ = "";
  60. update();
  61. function update(){
  62. $.get("opr.php?opr=query", function (data) {
  63. var currTime = JSON.parse(data);
  64. serverTZ = currTime["timezone"];
  65. updatelist();
  66. });
  67. }
  68. function updatelist(){
  69. $("#tz").html('<option linuxtz="NA" wintz="NA">Updating...</option>');
  70. $.get("opr.php?opr=alltimezone", function (data) {
  71. $("#tz").html("");
  72. var timezone = JSON.parse(data);
  73. $.each(timezone, function(i, field){
  74. var friendlyname = field[0];
  75. if(serverTZ == field[1]){
  76. friendlyname = friendlyname + " (Current)";
  77. }
  78. if(computerTZ == field[1]){
  79. friendlyname = friendlyname + " (Suggested)";
  80. }
  81. $("#tz").append('<option linuxtz="' + field[1] + '" wintz="' + field[2] + '">' + friendlyname + "</option>");
  82. });
  83. $('#tz option[linuxtz="' + serverTZ + '"]').attr('selected','selected');
  84. });
  85. }
  86. function changetimezone(){
  87. $.ajax({url:"opr.php?opr=modify&tz=" + $('#tz option:selected').attr('linuxtz'),async:false});
  88. msg("Success.");
  89. update();
  90. }
  91. function msg(content) {
  92. ts('.snackbar').snackbar({
  93. content: content,
  94. actionEmphasis: 'negative',
  95. });
  96. }
  97. </script>
  98. </body>
  99. </html>