Admin.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div class='app'>
  3. <main-header></main-header>
  4. <div class='tabs is-centered'>
  5. <ul>
  6. <li :class='{ "is-active": currentTab == "queueSongs" }' @click='showTab("queueSongs")'>
  7. <a v-link="{ path: '/admin/queuesongs' }">
  8. <i class='material-icons'>queue_music</i>
  9. <span>&nbsp;Queue Songs</span>
  10. </a>
  11. </li>
  12. <li :class='{ "is-active": currentTab == "songs" }' @click='showTab("songs")'>
  13. <a v-link="{ path: '/admin/songs' }">
  14. <i class='material-icons'>music_note</i>
  15. <span>&nbsp;Songs</span>
  16. </a>
  17. </li>
  18. <li :class='{ "is-active": currentTab == "stations" }' @click='showTab("stations")'>
  19. <a v-link="{ path: '/admin/stations' }">
  20. <i class='material-icons'>hearing</i>
  21. <span>&nbsp;Stations</span>
  22. </a>
  23. </li>
  24. <li :class='{ "is-active": currentTab == "reports" }' @click='showTab("reports")'>
  25. <a v-link="{ path: '/admin/reports' }">
  26. <i class="material-icons">report_problem</i>
  27. <span>&nbsp;Reports</span>
  28. </a>
  29. </li>
  30. <li :class='{ "is-active": currentTab == "news" }' @click='showTab("news")'>
  31. <a v-link="{ path: '/admin/news' }">
  32. <i class="material-icons">chrome_reader_mode</i>
  33. <span>&nbsp;News</span>
  34. </a>
  35. </li>
  36. <li :class='{ "is-active": currentTab == "users" }' @click='showTab("users")'>
  37. <a v-link="{ path: '/admin/users' }">
  38. <i class="material-icons">person</i>
  39. <span>&nbsp;Users</span>
  40. </a>
  41. </li>
  42. <li :class='{ "is-active": currentTab == "statistics" }' @click='showTab("statistics")'>
  43. <a v-link="{ path: '/admin/statistics' }">
  44. <i class="material-icons">show_chart</i>
  45. <span>&nbsp;Statistics</span>
  46. </a>
  47. </li>
  48. <li :class='{ "is-active": currentTab == "punishments" }' @click='showTab("punishments")'>
  49. <a v-link="{ path: '/admin/punishments' }">
  50. <i class="material-icons">gavel</i>
  51. <span>&nbsp;Punishments</span>
  52. </a>
  53. </li>
  54. </ul>
  55. </div>
  56. <queue-songs v-if='currentTab == "queueSongs"'></queue-songs>
  57. <songs v-if='currentTab == "songs"'></songs>
  58. <stations v-if='currentTab == "stations"'></stations>
  59. <reports v-if='currentTab == "reports"'></reports>
  60. <news v-if='currentTab == "news"'></news>
  61. <users v-if='currentTab == "users"'></users>
  62. <statistics v-if='currentTab == "statistics"'></statistics>
  63. <punishments v-if='currentTab == "punishments"'></punishments>
  64. </div>
  65. </template>
  66. <script>
  67. import MainHeader from '../MainHeader.vue';
  68. import MainFooter from '../MainFooter.vue';
  69. import QueueSongs from '../Admin/QueueSongs.vue';
  70. import Songs from '../Admin/Songs.vue';
  71. import Stations from '../Admin/Stations.vue';
  72. import Reports from '../Admin/Reports.vue';
  73. import News from '../Admin/News.vue';
  74. import Users from '../Admin/Users.vue';
  75. import Statistics from '../Admin/Statistics.vue';
  76. import Punishments from '../Admin/Punishments.vue';
  77. export default {
  78. components: {
  79. MainHeader,
  80. MainFooter,
  81. QueueSongs,
  82. Songs,
  83. Stations,
  84. Reports,
  85. News,
  86. Users,
  87. Statistics,
  88. Punishments
  89. },
  90. ready() {
  91. switch(window.location.pathname) {
  92. case '/admin/queuesongs':
  93. this.currentTab = 'queueSongs';
  94. break;
  95. case '/admin/songs':
  96. this.currentTab = 'songs';
  97. break;
  98. case '/admin/stations':
  99. this.currentTab = 'stations';
  100. break;
  101. case '/admin/reports':
  102. this.currentTab = 'reports';
  103. break;
  104. case '/admin/news':
  105. this.currentTab = 'news';
  106. break;
  107. case '/admin/users':
  108. this.currentTab = 'users';
  109. break;
  110. case '/admin/statistics':
  111. this.currentTab = 'statistics';
  112. break;
  113. case '/admin/punishments':
  114. this.currentTab = 'punishments';
  115. break;
  116. default:
  117. this.currentTab = 'queueSongs';
  118. }
  119. },
  120. data() {
  121. return {
  122. currentTab: 'queueSongs'
  123. }
  124. },
  125. methods: {
  126. showTab: function (tab) {
  127. this.currentTab = tab;
  128. }
  129. }
  130. }
  131. </script>
  132. <style lang='scss' scoped>
  133. .is-active a {
  134. color: #03a9f4 !important;
  135. border-color: #03a9f4 !important;
  136. }
  137. </style>