Admin.vue 5.6 KB

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