index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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. @import "../../styles/global.scss";
  190. .night-mode {
  191. .tabs {
  192. background-color: #333;
  193. border: 0;
  194. ul {
  195. border-bottom: 0;
  196. }
  197. }
  198. }
  199. .main-container {
  200. height: auto;
  201. }
  202. .tabs {
  203. padding-top: 10px;
  204. margin-top: -10px;
  205. background-color: $white;
  206. .queueSongs {
  207. color: $teal;
  208. border-color: $teal;
  209. }
  210. .songs {
  211. color: $primary-color;
  212. border-color: $primary-color;
  213. }
  214. .stations {
  215. color: $purple;
  216. border-color: $purple;
  217. }
  218. .playlists {
  219. color: $light-purple;
  220. border-color: $light-purple;
  221. }
  222. .reports {
  223. color: $yellow;
  224. border-color: $yellow;
  225. }
  226. .news {
  227. color: $light-pink;
  228. border-color: $light-pink;
  229. }
  230. .users {
  231. color: $dark-pink;
  232. border-color: $dark-pink;
  233. }
  234. .statistics {
  235. color: $light-orange;
  236. border-color: $light-orange;
  237. }
  238. .newstatistics {
  239. color: $light-orange;
  240. border-color: $light-orange;
  241. }
  242. .punishments {
  243. color: $dark-orange;
  244. border-color: $dark-orange;
  245. }
  246. .tab {
  247. transition: all 0.2s ease-in-out;
  248. font-weight: 500;
  249. border-bottom: solid 0px;
  250. }
  251. .tab:hover {
  252. border-width: 3px;
  253. transition: all 0.2s ease-in-out;
  254. font-weight: 600;
  255. }
  256. .is-active .tab {
  257. font-weight: 600;
  258. border-width: 3px;
  259. }
  260. }
  261. </style>