index.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. require_once "../path.php";
  3. ?>
  4. <!DOCTYPE html >
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <title>PCD Sync</title>
  10. <script src="../public/js/jquery.js"></script>
  11. <script src="../public/js/comm.js"></script>
  12. <script src="sync.js"></script>
  13. </head>
  14. <body class="sync_body" onload="sync_index_init()">
  15. <div class="fun_block">
  16. <h2>Sync</h2>
  17. <div id="wiki_search" style="width:100%;">
  18. <div>
  19. <h3>Server Address</h3>
  20. <input id="sync_server_address" type="input" placeholder="server address" value="https://www.wikipali.org" style="width:30em;" />
  21. <h3>Local Address</h3>
  22. <input id="sync_local_address" type="input" placeholder="local address" value="" style="width:30em;" />
  23. <button onclick="sync_pull()">pull</button>
  24. <button onclick="sync_push()">push</button>
  25. </div>
  26. </div>
  27. <div>上次更新时间:</div>
  28. <div id="sync_result">
  29. </div>
  30. </div>
  31. <script>
  32. let localhost;
  33. let base = "/app/sync/";
  34. let path="";
  35. if(location.pathname.indexOf(base)>=0){
  36. path = location.pathname.slice(0,location.pathname.indexOf(base));
  37. }
  38. localhost=location.protocol +"//"+ location.hostname + location.port + path;
  39. $("#sync_local_address").val(localhost);
  40. </script>
  41. </body>
  42. </html>