ops.html 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <!-- Standard Meta -->
  5. <meta charset="utf-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  8. <!-- Site Properties -->
  9. <title>Minecraft Server</title>
  10. <script src="https://code.jquery.com/jquery-3.1.1.min.js" crossorigin="anonymous"></script>
  11. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
  12. <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
  13. <!-- MC Skin-->
  14. <link rel="stylesheet" href="/css/minecraft-skinviewer.css">
  15. </head>
  16. <body>
  17. <div class="ui divided items" id="userlist">
  18. </div>
  19. <div class="ui fluid input" style="position: fixed;bottom: 10px;width: 99vw;">
  20. <input type="text" id="uuid" placeholder="UUID">
  21. <div style="width:10px"></div>
  22. <input type="text" id="name" placeholder="Name">
  23. <div style="width:10px"></div>
  24. <input type="text" id="level" placeholder="Level">
  25. <div style="width:10px"></div>
  26. <input type="text" id="bypass" placeholder="BypassesPlayerLimit">
  27. <div style="width:10px"></div>
  28. <div class="ui button" onclick="submit()">Submit</div>
  29. </div>
  30. </body>
  31. <script>
  32. updateInfo();
  33. setInterval(function() {
  34. updateInfo()
  35. }, 5000);
  36. function updateInfo() {
  37. $.get("/ops", function(data) {
  38. if (data.length == 0) {
  39. $("#userlist").html(`
  40. <div class="item">
  41. <div class="content">
  42. <div class="header">No one here :(</div>
  43. </div>
  44. </div>
  45. `)
  46. return
  47. }
  48. $("#userlist").html("");
  49. $.each(data, function(i, item) {
  50. $("#userlist").append(`
  51. <div class="item">
  52. <div class="ui mini image" style="width:64px">
  53. <div class="mc-face-viewer-8x" style="background-image:url('/skin/` + item.uuid + `.png')"></div>
  54. </div>
  55. <div class="content">
  56. <div class="header">` + item.name + `</div>
  57. <div class="meta">
  58. <span>` + item.uuid + `</span>
  59. </div>
  60. </div>
  61. <div class="ui right floated buttons" style="display:block;margin:auto" username="` + item.name + `">
  62. <button onclick="deop(this)" class="ui red button">Deop</button>
  63. </div>
  64. </div>
  65. `)
  66. })
  67. $("#userlist").append('<div style="height:40px"></div>');
  68. });
  69. }
  70. function deop(btn) {
  71. var data = $(btn).parent().attr("username");
  72. $.get("/ops/remove?field=name&search=" + data);
  73. }
  74. function submit() {
  75. var uuid = $("#uuid").val();
  76. var name = $("#name").val();
  77. var level = $("#level").val();
  78. var bypass = $("#bypass").val();
  79. $.get("/ops/add?uuid=" + uuid + "&name=" + name + "&level=" + level + "&bypass=" + bypass);
  80. }
  81. </script>
  82. </html>