Admin.vue 3.1 KB

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