accesspoint.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. include '../../../auth.php';
  3. ?>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <meta charset="UTF-8">
  8. <link rel="stylesheet" href="../../../script/tocas/tocas.css">
  9. <script type='text/javascript' src="../../../script/tocas/tocas.js"></script>
  10. <script src="../../../script/jquery.min.js"></script>
  11. <title>WIFI</title>
  12. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  13. </head>
  14. <body>
  15. <div class="ts fluid borderless slate">
  16. <div class="ts segment" style="width:100%;">
  17. <div class="ts header">
  18. AP Settings
  19. <div class="sub header">AP SSID and Password can be modified here.</div>
  20. </div>
  21. </div>
  22. <div class="ts container">
  23. </div>
  24. </div>
  25. <br>
  26. <div class="ts container">
  27. <form id="form" class="ts form" id="wifi" action="">
  28. <table>
  29. <tr>
  30. <td>AP SSID</td>
  31. <td>
  32. <div class="ts mini fluid input"><input name="ssid" id="ssid" type="text" placeholder="SSID"></div>
  33. </td>
  34. </tr>
  35. <tr>
  36. <td>AP Password</td>
  37. <td>
  38. <div class="ts mini fluid input"><input type="password" placeholder="Password" id="psk" name="psk" pattern="[a-zA-Z0-9]{8,}"></div>
  39. </td>
  40. </tr>
  41. </table>
  42. </form>
  43. <table>
  44. <tr>
  45. <td colspan="2"><button onclick="update()" class="ts basic button">Update</button></td>
  46. </tr>
  47. </table>
  48. </div>
  49. <div class="ts snackbar">
  50. <div class="content"></div>
  51. <a class="action"></a>
  52. </div>
  53. <script>
  54. startup();
  55. function startup(){
  56. //Please ADD ALL LOAD ON STARTUP SCRIPT HERE
  57. loadstatus();
  58. }
  59. function loadstatus(){
  60. $.getJSON("opr.php?opr=viewapsetting", function (data) {
  61. $("#ssid").val(data["ssid"]);
  62. $("#psk").val(data["wpa_passphrase"]);
  63. });
  64. }
  65. function msg(content) {
  66. ts('.snackbar').snackbar({
  67. content: content,
  68. actionEmphasis: 'negative',
  69. });
  70. }
  71. function update(){
  72. $.post( "opr.php?opr=setap", $( "#form" ).serialize()).done(function() {
  73. msg("AP Settings Updated. Changes will be made after reboot.");
  74. });
  75. }
  76. </script>
  77. </body>
  78. </html>