index.vue 6.3 KB

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