123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <template>
- <div class="app">
- <main-header />
- <div class="tabs is-centered">
- <ul>
- <li
- :class="{ 'is-active': currentTab == 'hiddensongs' }"
- ref="hiddensongs-tab"
- @click="showTab('hiddensongs')"
- >
- <router-link
- class="tab hiddensongs"
- to="/admin/hiddensongs"
- >
- <i class="material-icons">music_note</i>
- <span> Hidden Songs</span>
- </router-link>
- </li>
- <li
- :class="{ 'is-active': currentTab == 'unverifiedsongs' }"
- ref="unverifiedsongs-tab"
- @click="showTab('unverifiedsongs')"
- >
- <router-link
- class="tab unverifiedsongs"
- to="/admin/unverifiedsongs"
- >
- <i class="material-icons">unpublished</i>
- <span> Unverified Songs</span>
- </router-link>
- </li>
- <li
- :class="{ 'is-active': currentTab == 'verifiedsongs' }"
- ref="verifiedsongs-tab"
- @click="showTab('verifiedsongs')"
- >
- <router-link
- class="tab verifiedsongs"
- to="/admin/verifiedsongs"
- >
- <i class="material-icons">check_circle</i>
- <span> Verified Songs</span>
- </router-link>
- </li>
- <li
- :class="{ 'is-active': currentTab == 'stations' }"
- ref="stations-tab"
- @click="showTab('stations')"
- >
- <router-link class="tab stations" to="/admin/stations">
- <i class="material-icons">radio</i>
- <span> Stations</span>
- </router-link>
- </li>
- <li
- :class="{ 'is-active': currentTab == 'playlists' }"
- ref="playlists-tab"
- @click="showTab('playlists')"
- >
- <router-link class="tab playlists" to="/admin/playlists">
- <i class="material-icons">library_music</i>
- <span> Playlists</span>
- </router-link>
- </li>
- <li
- :class="{ 'is-active': currentTab == 'reports' }"
- ref="reports-tab"
- @click="showTab('reports')"
- >
- <router-link class="tab reports" to="/admin/reports">
- <i class="material-icons">flag</i>
- <span> Reports</span>
- </router-link>
- </li>
- <li
- :class="{ 'is-active': currentTab == 'news' }"
- ref="news-tab"
- @click="showTab('news')"
- >
- <router-link class="tab news" to="/admin/news">
- <i class="material-icons">chrome_reader_mode</i>
- <span> News</span>
- </router-link>
- </li>
- <li
- :class="{ 'is-active': currentTab == 'users' }"
- ref="users-tab"
- @click="showTab('users')"
- >
- <router-link class="tab users" to="/admin/users">
- <i class="material-icons">people</i>
- <span> Users</span>
- </router-link>
- </li>
- <li
- :class="{ 'is-active': currentTab == 'statistics' }"
- ref="statistics-tab"
- @click="showTab('statistics')"
- >
- <router-link class="tab statistics" to="/admin/statistics">
- <i class="material-icons">show_chart</i>
- <span> Statistics</span>
- </router-link>
- </li>
- <li
- :class="{ 'is-active': currentTab == 'punishments' }"
- ref="punishments-tab"
- @click="showTab('punishments')"
- >
- <router-link
- class="tab punishments"
- to="/admin/punishments"
- >
- <i class="material-icons">gavel</i>
- <span> Punishments</span>
- </router-link>
- </li>
- </ul>
- </div>
- <unverified-songs v-if="currentTab == 'unverifiedsongs'" />
- <verified-songs v-if="currentTab == 'verifiedsongs'" />
- <hidden-songs v-if="currentTab == 'hiddensongs'" />
- <stations v-if="currentTab == 'stations'" />
- <playlists v-if="currentTab == 'playlists'" />
- <reports v-if="currentTab == 'reports'" />
- <news v-if="currentTab == 'news'" />
- <users v-if="currentTab == 'users'" />
- <statistics v-if="currentTab == 'statistics'" />
- <punishments v-if="currentTab == 'punishments'" />
- </div>
- </template>
- <script>
- import { mapGetters } from "vuex";
- import MainHeader from "@/components/layout/MainHeader.vue";
- export default {
- components: {
- MainHeader,
- UnverifiedSongs: () => import("./tabs/UnverifiedSongs.vue"),
- VerifiedSongs: () => import("./tabs/VerifiedSongs.vue"),
- HiddenSongs: () => import("./tabs/HiddenSongs.vue"),
- Stations: () => import("./tabs/Stations.vue"),
- Playlists: () => import("./tabs/Playlists.vue"),
- Reports: () => import("./tabs/Reports.vue"),
- News: () => import("./tabs/News.vue"),
- Users: () => import("./tabs/Users.vue"),
- Statistics: () => import("./tabs/Statistics.vue"),
- Punishments: () => import("./tabs/Punishments.vue")
- },
- data() {
- return {
- currentTab: ""
- };
- },
- computed: mapGetters({
- socket: "websockets/getSocket"
- }),
- watch: {
- $route(route) {
- this.changeTab(route.path);
- }
- },
- mounted() {
- this.changeTab(this.$route.path);
- },
- beforeDestroy() {
- this.socket.dispatch("apis.leaveRooms", () => {});
- },
- methods: {
- changeTab(path) {
- switch (path) {
- case "/admin/unverifiedsongs":
- this.showTab("unverifiedsongs");
- break;
- case "/admin/verifiedsongs":
- this.showTab("verifiedsongs");
- break;
- case "/admin/hiddensongs":
- this.showTab("hiddensongs");
- break;
- case "/admin/stations":
- this.showTab("stations");
- break;
- case "/admin/playlists":
- this.showTab("playlists");
- break;
- case "/admin/reports":
- this.showTab("reports");
- break;
- case "/admin/news":
- this.showTab("news");
- break;
- case "/admin/users":
- this.showTab("users");
- break;
- case "/admin/statistics":
- this.showTab("statistics");
- break;
- case "/admin/punishments":
- this.showTab("punishments");
- break;
- default:
- this.showTab("verifiedsongs");
- }
- },
- showTab(tab) {
- if (this.$refs[`${tab}-tab`])
- this.$refs[`${tab}-tab`].scrollIntoView({
- inline: "center"
- });
- this.currentTab = tab;
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .night-mode {
- .tabs {
- background-color: var(--dark-grey-2);
- border: 0;
- ul {
- border-bottom: 0;
- }
- }
- }
- .main-container {
- height: auto;
- }
- .tabs {
- padding-top: 10px;
- margin-top: -10px;
- background-color: var(--white);
- .unverifiedsongs {
- color: var(--teal);
- border-color: var(--teal);
- }
- .verifiedsongs {
- color: var(--primary-color);
- border-color: var(--primary-color);
- }
- .hiddensongs {
- color: var(--grey);
- border-color: var(--grey);
- }
- .stations {
- color: var(--purple);
- border-color: var(--purple);
- }
- .playlists {
- color: var(--light-purple);
- border-color: var(--light-purple);
- }
- .reports {
- color: var(--yellow);
- border-color: var(--yellow);
- }
- .news {
- color: var(--light-pink);
- border-color: var(--light-pink);
- }
- .users {
- color: var(--dark-pink);
- border-color: var(--dark-pink);
- }
- .statistics {
- color: var(--orange);
- border-color: var(--orange);
- }
- .punishments {
- color: var(--dark-orange);
- border-color: var(--dark-orange);
- }
- .tab {
- transition: all 0.2s ease-in-out;
- font-weight: 500;
- border-bottom: solid 0px;
- }
- .tab:hover {
- border-width: 3px;
- transition: all 0.2s ease-in-out;
- font-weight: 600;
- }
- .is-active .tab {
- font-weight: 600;
- border-width: 3px;
- }
- }
- </style>
|