Admin.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. </ul>
  49. </div>
  50. <queue-songs v-if='currentTab == "queueSongs"'></queue-songs>
  51. <songs v-if='currentTab == "songs"'></songs>
  52. <stations v-if='currentTab == "stations"'></stations>
  53. <reports v-if='currentTab == "reports"'></reports>
  54. <news v-if='currentTab == "news"'></news>
  55. <users v-if='currentTab == "users"'></users>
  56. <statistics v-if='currentTab == "statistics"'></statistics>
  57. </div>
  58. </template>
  59. <script>
  60. import MainHeader from '../MainHeader.vue';
  61. import MainFooter from '../MainFooter.vue';
  62. import QueueSongs from '../Admin/QueueSongs.vue';
  63. import Songs from '../Admin/Songs.vue';
  64. import Stations from '../Admin/Stations.vue';
  65. import Reports from '../Admin/Reports.vue';
  66. import News from '../Admin/News.vue';
  67. import Users from '../Admin/Users.vue';
  68. import Statistics from '../Admin/Statistics.vue';
  69. export default {
  70. components: {
  71. MainHeader,
  72. MainFooter,
  73. QueueSongs,
  74. Songs,
  75. Stations,
  76. Reports,
  77. News,
  78. Users,
  79. Statistics
  80. },
  81. ready() {
  82. switch(window.location.pathname) {
  83. case '/admin/queuesongs':
  84. this.currentTab = 'queueSongs';
  85. break;
  86. case '/admin/songs':
  87. this.currentTab = 'songs';
  88. break;
  89. case '/admin/stations':
  90. this.currentTab = 'stations';
  91. break;
  92. case '/admin/reports':
  93. this.currentTab = 'reports';
  94. break;
  95. case '/admin/news':
  96. this.currentTab = 'news';
  97. break;
  98. case '/admin/users':
  99. this.currentTab = 'users';
  100. break;
  101. case '/admin/statistics':
  102. this.currentTab = 'statistics';
  103. break;
  104. default:
  105. this.currentTab = 'queueSongs';
  106. }
  107. },
  108. data() {
  109. return {
  110. currentTab: 'queueSongs'
  111. }
  112. },
  113. methods: {
  114. showTab: function (tab) {
  115. this.currentTab = tab;
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang='scss' scoped>
  121. .is-active a {
  122. color: #03a9f4 !important;
  123. border-color: #03a9f4 !important;
  124. }
  125. </style>