server.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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 - Server</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"
  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 - Manage Server
  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: Manage Server -->
  95. <section>
  96. <h1>Manage server</h1>
  97. <div class="row">
  98. <div class="col-xl-3 col-sm-6 col-12 mb-4">
  99. <div class="card">
  100. <div class="card-body">
  101. <div class="d-flex justify-content-between px-md-1">
  102. <div>
  103. <h3 class="text-danger" id="songInQueue">0</h3>
  104. <p class="mb-0">Song in queue</p>
  105. </div>
  106. <div class="align-self-center">
  107. <i class="fas fa-music text-danger fa-3x"></i>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="col-xl-3 col-sm-6 col-12 mb-4">
  114. <div class="card">
  115. <div class="card-body">
  116. <div class="d-flex justify-content-between px-md-1">
  117. <div>
  118. <h3 class="text-success" id="songLoop"></h3>
  119. <p class="mb-0">Song Loop</p>
  120. </div>
  121. <div class="align-self-center">
  122. <i class="fas fa-redo text-success fa-3x"></i>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. <div class="col-xl-3 col-sm-6 col-12 mb-4">
  129. <div class="card">
  130. <div class="card-body">
  131. <div class="d-flex justify-content-between px-md-1">
  132. <div>
  133. <h3 class="text-warning" id="queueLoop"></h3>
  134. <p class="mb-0">Queue Loop</p>
  135. </div>
  136. <div class="align-self-center">
  137. <i class="fas fa-sync text-warning fa-3x"></i>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. <div class="col-xl-3 col-sm-6 col-12 mb-4">
  144. <div class="card">
  145. <div class="card-body">
  146. <div class="d-flex justify-content-between px-md-1">
  147. <div>
  148. <h3 class="text-info" id="prefix">&gt;</h3>
  149. <p class="mb-0">Prefix</p>
  150. </div>
  151. <div class="align-self-center">
  152. <i class="fas fa-robot text-info fa-3x"></i>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. <div class="container text-center" id="song-info">
  160. <h1>Song info</h1>
  161. <p>Now playing: <span id="now-playing"></span></p>
  162. <br />
  163. <p>Duration</p>
  164. <p id="duration"></p>
  165. </div>
  166. </section>
  167. <!-- Footer -->
  168. <div class="footer">
  169. <div class="container">
  170. <div class="row">
  171. <div class="col-md-12">
  172. <div class="copyright-text">
  173. <p>
  174. © 2021
  175. <a href="//github.com/SudhanPlayz/Discord-MusicBot"
  176. >Discord Music Bot</a
  177. >. All rights reserved. Made by
  178. <a href="//github.com/SudhanPlayz">Sudhan</a> and its
  179. <a
  180. href="//github.com/SudhanPlayz/Discord-MusicBot/graphs/contributors"
  181. >contributers</a
  182. >
  183. </p>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. <!-- End Footer -->
  190. </div>
  191. </main>
  192. <!--Main layout-->
  193. </section>
  194. <script
  195. src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js"
  196. integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf"
  197. crossorigin="anonymous"
  198. ></script>
  199. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  200. <script src="https://cdn.socket.io/4.0.1/socket.io.min.js"></script>
  201. </body>
  202. <style>
  203. body {
  204. background: var(--bs-gray-dark);
  205. color: #fff;
  206. overflow-x: hidden;
  207. }
  208. .card {
  209. color: black;
  210. }
  211. @media (min-width: 991.98px) {
  212. main {
  213. padding-left: 240px;
  214. }
  215. }
  216. /* Sidebar */
  217. .sidebar {
  218. position: fixed;
  219. top: 0;
  220. bottom: 0;
  221. left: 0;
  222. padding: 58px 0 0; /* Height of navbar */
  223. box-shadow: 0 2px 5px 0 rgb(0 0 0 / 5%), 0 2px 10px 0 rgb(0 0 0 / 5%);
  224. width: 240px;
  225. z-index: 600;
  226. }
  227. @media (max-width: 991.98px) {
  228. .sidebar {
  229. width: 100%;
  230. }
  231. }
  232. .sidebar .active {
  233. border-radius: 5px;
  234. box-shadow: 0 2px 5px 0 rgb(0 0 0 / 16%), 0 2px 10px 0 rgb(0 0 0 / 12%);
  235. }
  236. .sidebar-sticky {
  237. position: relative;
  238. top: 0;
  239. height: calc(100vh - 48px);
  240. padding-top: 0.5rem;
  241. overflow-x: hidden;
  242. overflow-y: auto;
  243. }
  244. #song-info span {
  245. color: #5867dd;
  246. text-decoration: none;
  247. cursor: pointer;
  248. }
  249. #song-info span:hover {
  250. color: #34bfa3;
  251. }
  252. .footer {
  253. position: fixed;
  254. bottom: 0;
  255. background: #192027;
  256. text-align: center;
  257. padding: 32px 0;
  258. width: 85%;
  259. overflow: hidden;
  260. }
  261. .footer p {
  262. margin: 0;
  263. line-height: 26px;
  264. font-size: 15px;
  265. color: #999;
  266. }
  267. .footer p a {
  268. color: #5867dd;
  269. text-decoration: none;
  270. }
  271. .footer p a:hover {
  272. color: #34bfa3;
  273. }
  274. ::-webkit-scrollbar {
  275. width: 15px;
  276. }
  277. ::-webkit-scrollbar-track {
  278. background: #192027;
  279. }
  280. ::-webkit-scrollbar-thumb {
  281. background: #5867dd;
  282. border-radius: 20px;
  283. }
  284. ::-webkit-scrollbar-thumb:hover {
  285. background: #414ca1;
  286. }
  287. </style>
  288. <script>
  289. $(document).ready(() => {
  290. $.get("/api/user", (data) => {
  291. let Guild = data.user.guilds.find(
  292. (x) => x.id == window.location.pathname.split("/")[2]
  293. );
  294. if (!Guild.inGuild) {
  295. $.get("/api/info", (data) => {
  296. window.location = `https://discord.com/oauth2/authorize?client_id=${
  297. data.ClientID
  298. }&permissions=${data.Permissions}&scope=bot%20${data.Scopes.join(
  299. "%20"
  300. )}&redirect_uri=${data.Website}${
  301. data.CallbackURL
  302. }&response_type=code`;
  303. });
  304. }
  305. $(".server-name").text(Guild.name);
  306. });
  307. var socket = io();
  308. socket.emit("server", window.location.pathname.split("/")[2]);
  309. socket.on("server", (data) => {
  310. $("#songLoop").text(data.songsLoop);
  311. $("#queueLoop").text(data.queueLoop);
  312. $("#prefix").text(data.prefix);
  313. $("#now-playing").text(
  314. data.nowPlaying ? data.nowPlaying.title : "Nothing playing"
  315. );
  316. if (data.position)
  317. $("#duration").html(
  318. `${data.position}<span> ${data.bar} </span>${data.maxDuration}`
  319. );
  320. else
  321. $("#duration").html(
  322. `<span> Nothing is playing right now, Add some songs in discord? </span>`
  323. );
  324. });
  325. });
  326. </script>
  327. </html>