servers.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>Dashboard - Servers</title>
  8. <link rel="shortcut icon" href="/logo.gif" type="image/gif" />
  9. <link
  10. href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css"
  11. rel="stylesheet"
  12. integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6"
  13. crossorigin="anonymous"
  14. />
  15. <link
  16. rel="stylesheet"
  17. href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css"
  18. />
  19. <link
  20. rel="stylesheet"
  21. href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/fontawesome.min.css"
  22. />
  23. </head>
  24. <body>
  25. <section class="main">
  26. <!--Main Navigation-->
  27. <header>
  28. <!-- Sidebar -->
  29. <nav id="sidebarMenu" class="collapse d-lg-block sidebar collapse">
  30. <div class="position-sticky">
  31. <div class="list-group list-group-flush mx-3 mt-4">
  32. <a
  33. href="/dashboard"
  34. class="list-group-item list-group-item-action py-2 ripple"
  35. aria-current="true"
  36. >
  37. <i class="fas fa-tachometer-alt fa-fw me-3"></i
  38. ><span>Main dashboard</span>
  39. </a>
  40. <a
  41. href="/servers"
  42. class="list-group-item list-group-item-action py-2 ripple active"
  43. >
  44. <i class="fas fa-server fa-fw me-3"></i
  45. ><span>Manage Servers</span>
  46. </a>
  47. <a
  48. href="/logout"
  49. class="list-group-item list-group-item-action py-2 ripple"
  50. >
  51. <i class="fas fa-sign-out-alt fa-fw me-3"></i
  52. ><span>Logout</span>
  53. </a>
  54. </div>
  55. </div>
  56. </nav>
  57. <!-- Sidebar -->
  58. <!-- Navbar -->
  59. <nav
  60. id="main-navbar"
  61. class="navbar navbar-expand-lg navbar-light fixed-top"
  62. >
  63. <!-- Container wrapper -->
  64. <div class="container-fluid">
  65. <!-- Toggle button -->
  66. <button
  67. class="navbar-toggler"
  68. type="button"
  69. data-mdb-toggle="collapse"
  70. data-mdb-target="#sidebarMenu"
  71. aria-controls="sidebarMenu"
  72. aria-expanded="false"
  73. aria-label="Toggle navigation"
  74. onclick="function re(){ let r = $('#sidebarMenu'); if(r.hasClass('collapse'))r.removeClass('collapse');else r.addClass('collapse')}re()"
  75. >
  76. <i class="fas fa-bars"></i>
  77. </button>
  78. <!-- Brand -->
  79. <a class="navbar-brand text-white" href="/">
  80. <img src="/logo.gif" height="40" alt="" loading="lazy" />
  81. Dashboard - Servers
  82. </a>
  83. <div>
  84. <h1 class="server-name"></h1>
  85. </div>
  86. </div>
  87. </nav>
  88. <!-- Navbar -->
  89. </header>
  90. <!--Main Navigation-->
  91. <!--Main layout-->
  92. <main style="margin-top: 58px">
  93. <div class="container pt-4">
  94. <!--Section: Main-->
  95. <section>
  96. <h1>Select a server to manage</h1>
  97. <div id="servers" class="flex"></div>
  98. </section>
  99. <!-- Footer -->
  100. <div class="footer">
  101. <div class="container">
  102. <div class="row">
  103. <div class="col-md-12">
  104. <div class="copyright-text">
  105. <p>
  106. © 2021
  107. <a href="//github.com/SudhanPlayz/Discord-MusicBot"
  108. >Discord Music Bot</a
  109. >. All rights reserved. Made by
  110. <a href="//github.com/SudhanPlayz">Sudhan</a> and its
  111. <a
  112. href="//github.com/SudhanPlayz/Discord-MusicBot/graphs/contributors"
  113. >contributers</a
  114. >
  115. </p>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <!-- End Footer -->
  122. </div>
  123. </main>
  124. <!--Main layout-->
  125. </section>
  126. <script
  127. src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js"
  128. integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf"
  129. crossorigin="anonymous"
  130. ></script>
  131. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  132. <script src="https://cdn.socket.io/4.0.1/socket.io.min.js"></script>
  133. </body>
  134. <style>
  135. body {
  136. background: var(--bs-gray-dark);
  137. color: #fff;
  138. overflow-x: hidden;
  139. }
  140. @media (min-width: 991.98px) {
  141. main {
  142. padding-left: 240px;
  143. }
  144. }
  145. /* Sidebar */
  146. .sidebar {
  147. position: fixed;
  148. top: 0;
  149. bottom: 0;
  150. left: 0;
  151. padding: 58px 0 0; /* Height of navbar */
  152. box-shadow: 0 2px 5px 0 rgb(0 0 0 / 5%), 0 2px 10px 0 rgb(0 0 0 / 5%);
  153. width: 240px;
  154. z-index: 600;
  155. }
  156. @media (max-width: 991.98px) {
  157. .sidebar {
  158. width: 100%;
  159. }
  160. }
  161. .sidebar .active {
  162. border-radius: 5px;
  163. box-shadow: 0 2px 5px 0 rgb(0 0 0 / 16%), 0 2px 10px 0 rgb(0 0 0 / 12%);
  164. }
  165. .sidebar-sticky {
  166. position: relative;
  167. top: 0;
  168. height: calc(100vh - 48px);
  169. padding-top: 0.5rem;
  170. overflow-x: hidden;
  171. overflow-y: auto;
  172. }
  173. #servers img {
  174. border-radius: 50%;
  175. margin: 10px;
  176. cursor: pointer;
  177. }
  178. .hide {
  179. display: none;
  180. }
  181. .footer {
  182. position: absolute;
  183. bottom: 0;
  184. background: #192027;
  185. text-align: center;
  186. padding: 32px 0;
  187. width: 85%;
  188. }
  189. .footer p {
  190. margin: 0;
  191. line-height: 26px;
  192. font-size: 15px;
  193. color: #999;
  194. }
  195. .footer p a {
  196. color: #5867dd;
  197. text-decoration: none;
  198. }
  199. .footer p a:hover {
  200. color: #34bfa3;
  201. }
  202. ::-webkit-scrollbar {
  203. width: 15px;
  204. }
  205. ::-webkit-scrollbar-track {
  206. background: #192027;
  207. }
  208. ::-webkit-scrollbar-thumb {
  209. background: #5867dd;
  210. border-radius: 20px;
  211. }
  212. ::-webkit-scrollbar-thumb:hover {
  213. background: #414ca1;
  214. }
  215. </style>
  216. <script>
  217. $(document).ready(() => {
  218. $.get("/api/user", (data) => {
  219. data.user.guilds.forEach((Guild) => {
  220. if (!Guild.hasPerms) return;
  221. $("#servers").append(`
  222. <img class="server-${Guild.id}" onclick="window.location = '/servers/${
  223. Guild.id
  224. }'" width="60" height="60" src="${
  225. Guild.icon
  226. ? `https://cdn.discordapp.com/icons/${Guild.id}/${Guild.icon}.png`
  227. : "https://www.webcolorsonline.com/images/error.png"
  228. }" alt="${Guild.name}">
  229. `); //yes ofcource im an IDIOT
  230. $(`.server-${Guild.id}`).hover(() => {
  231. $(".server-name").text(Guild.name);
  232. });
  233. });
  234. });
  235. });
  236. </script>
  237. </html>