index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <div class="app">
  3. <main-header />
  4. <div class="tabs is-centered">
  5. <ul>
  6. <li
  7. :class="{ 'is-active': currentTab == 'hiddensongs' }"
  8. @click="showTab('hiddensongs')"
  9. >
  10. <router-link
  11. class="tab hiddensongs"
  12. to="/admin/hiddensongs"
  13. >
  14. <i class="material-icons">music_note</i>
  15. <span>&nbsp;Hidden Songs</span>
  16. </router-link>
  17. </li>
  18. <li
  19. :class="{ 'is-active': currentTab == 'unverifiedsongs' }"
  20. @click="showTab('unverifiedsongs')"
  21. >
  22. <router-link
  23. class="tab unverifiedsongs"
  24. to="/admin/unverifiedsongs"
  25. >
  26. <i class="material-icons">unpublished</i>
  27. <span>&nbsp;Unverified Songs</span>
  28. </router-link>
  29. </li>
  30. <li
  31. :class="{ 'is-active': currentTab == 'verifiedsongs' }"
  32. @click="showTab('verifiedsongs')"
  33. >
  34. <router-link
  35. class="tab verifiedsongs"
  36. to="/admin/verifiedsongs"
  37. >
  38. <i class="material-icons">check_circle</i>
  39. <span>&nbsp;Verified Songs</span>
  40. </router-link>
  41. </li>
  42. <li
  43. :class="{ 'is-active': currentTab == 'stations' }"
  44. @click="showTab('stations')"
  45. >
  46. <router-link class="tab stations" to="/admin/stations">
  47. <i class="material-icons">radio</i>
  48. <span>&nbsp;Stations</span>
  49. </router-link>
  50. </li>
  51. <li
  52. :class="{ 'is-active': currentTab == 'playlists' }"
  53. @click="showTab('playlists')"
  54. >
  55. <router-link class="tab playlists" to="/admin/playlists">
  56. <i class="material-icons">library_music</i>
  57. <span>&nbsp;Playlists</span>
  58. </router-link>
  59. </li>
  60. <li
  61. :class="{ 'is-active': currentTab == 'reports' }"
  62. @click="showTab('reports')"
  63. >
  64. <router-link class="tab reports" to="/admin/reports">
  65. <i class="material-icons">flag</i>
  66. <span>&nbsp;Reports</span>
  67. </router-link>
  68. </li>
  69. <li
  70. :class="{ 'is-active': currentTab == 'news' }"
  71. @click="showTab('news')"
  72. >
  73. <router-link class="tab news" to="/admin/news">
  74. <i class="material-icons">chrome_reader_mode</i>
  75. <span>&nbsp;News</span>
  76. </router-link>
  77. </li>
  78. <li
  79. :class="{ 'is-active': currentTab == 'users' }"
  80. @click="showTab('users')"
  81. >
  82. <router-link class="tab users" to="/admin/users">
  83. <i class="material-icons">people</i>
  84. <span>&nbsp;Users</span>
  85. </router-link>
  86. </li>
  87. <li
  88. :class="{ 'is-active': currentTab == 'statistics' }"
  89. @click="showTab('statistics')"
  90. >
  91. <router-link class="tab statistics" to="/admin/statistics">
  92. <i class="material-icons">show_chart</i>
  93. <span>&nbsp;Statistics</span>
  94. </router-link>
  95. </li>
  96. <li
  97. :class="{ 'is-active': currentTab == 'punishments' }"
  98. @click="showTab('punishments')"
  99. >
  100. <router-link
  101. class="tab punishments"
  102. to="/admin/punishments"
  103. >
  104. <i class="material-icons">gavel</i>
  105. <span>&nbsp;Punishments</span>
  106. </router-link>
  107. </li>
  108. </ul>
  109. </div>
  110. <unverified-songs v-if="currentTab == 'unverifiedsongs'" />
  111. <verified-songs v-if="currentTab == 'verifiedsongs'" />
  112. <hidden-songs v-if="currentTab == 'hiddensongs'" />
  113. <stations v-if="currentTab == 'stations'" />
  114. <playlists v-if="currentTab == 'playlists'" />
  115. <reports v-if="currentTab == 'reports'" />
  116. <news v-if="currentTab == 'news'" />
  117. <users v-if="currentTab == 'users'" />
  118. <statistics v-if="currentTab == 'statistics'" />
  119. <punishments v-if="currentTab == 'punishments'" />
  120. </div>
  121. </template>
  122. <script>
  123. import MainHeader from "@/components/layout/MainHeader.vue";
  124. export default {
  125. components: {
  126. MainHeader,
  127. UnverifiedSongs: () => import("./tabs/UnverifiedSongs.vue"),
  128. VerifiedSongs: () => import("./tabs/VerifiedSongs.vue"),
  129. HiddenSongs: () => import("./tabs/HiddenSongs.vue"),
  130. Stations: () => import("./tabs/Stations.vue"),
  131. Playlists: () => import("./tabs/Playlists.vue"),
  132. Reports: () => import("./tabs/Reports.vue"),
  133. News: () => import("./tabs/News.vue"),
  134. Users: () => import("./tabs/Users.vue"),
  135. Statistics: () => import("./tabs/Statistics.vue"),
  136. Punishments: () => import("./tabs/Punishments.vue")
  137. },
  138. data() {
  139. return {
  140. currentTab: ""
  141. };
  142. },
  143. watch: {
  144. $route(route) {
  145. this.changeTab(route.path);
  146. }
  147. },
  148. mounted() {
  149. this.changeTab(this.$route.path);
  150. },
  151. beforeDestroy() {
  152. this.socket.dispatch("apis.leaveRooms", () => {});
  153. },
  154. methods: {
  155. changeTab(path) {
  156. switch (path) {
  157. case "/admin/unverifiedsongs":
  158. this.currentTab = "unverifiedsongs";
  159. break;
  160. case "/admin/verifiedsongs":
  161. this.currentTab = "verifiedsongs";
  162. break;
  163. case "/admin/hiddensongs":
  164. this.currentTab = "hiddensongs";
  165. break;
  166. case "/admin/stations":
  167. this.currentTab = "stations";
  168. break;
  169. case "/admin/playlists":
  170. this.currentTab = "playlists";
  171. break;
  172. case "/admin/reports":
  173. this.currentTab = "reports";
  174. break;
  175. case "/admin/news":
  176. this.currentTab = "news";
  177. break;
  178. case "/admin/users":
  179. this.currentTab = "users";
  180. break;
  181. case "/admin/statistics":
  182. this.currentTab = "statistics";
  183. break;
  184. case "/admin/punishments":
  185. this.currentTab = "punishments";
  186. break;
  187. default:
  188. this.currentTab = "verifiedsongs";
  189. }
  190. },
  191. showTab(tab) {
  192. this.currentTab = tab;
  193. }
  194. }
  195. };
  196. </script>
  197. <style lang="scss" scoped>
  198. .night-mode {
  199. .tabs {
  200. background-color: var(--dark-grey-2);
  201. border: 0;
  202. ul {
  203. border-bottom: 0;
  204. }
  205. }
  206. }
  207. .main-container {
  208. height: auto;
  209. }
  210. .tabs {
  211. padding-top: 10px;
  212. margin-top: -10px;
  213. background-color: var(--white);
  214. .unverifiedsongs {
  215. color: var(--teal);
  216. border-color: var(--teal);
  217. }
  218. .verifiedsongs {
  219. color: var(--primary-color);
  220. border-color: var(--primary-color);
  221. }
  222. .hiddensongs {
  223. color: var(--grey);
  224. border-color: var(--grey);
  225. }
  226. .stations {
  227. color: var(--purple);
  228. border-color: var(--purple);
  229. }
  230. .playlists {
  231. color: var(--light-purple);
  232. border-color: var(--light-purple);
  233. }
  234. .reports {
  235. color: var(--yellow);
  236. border-color: var(--yellow);
  237. }
  238. .news {
  239. color: var(--light-pink);
  240. border-color: var(--light-pink);
  241. }
  242. .users {
  243. color: var(--dark-pink);
  244. border-color: var(--dark-pink);
  245. }
  246. .statistics {
  247. color: var(--orange);
  248. border-color: var(--orange);
  249. }
  250. .punishments {
  251. color: var(--dark-orange);
  252. border-color: var(--dark-orange);
  253. }
  254. .tab {
  255. transition: all 0.2s ease-in-out;
  256. font-weight: 500;
  257. border-bottom: solid 0px;
  258. }
  259. .tab:hover {
  260. border-width: 3px;
  261. transition: all 0.2s ease-in-out;
  262. font-weight: 600;
  263. }
  264. .is-active .tab {
  265. font-weight: 600;
  266. border-width: 3px;
  267. }
  268. }
  269. </style>