Browse Source

Added option to switch between Kris and Owen version of ManageStation

Kristian Vos 3 years ago
parent
commit
a65f4d6fa7

+ 1 - 0
frontend/dist/config/template.json

@@ -22,6 +22,7 @@
 	"messages": {
 		"accountRemoval": "Your account will be deactivated instantly and your data will shortly be deleted by an admin."
 	},
+	"manageStationVersion": "kris or owen",
 	"skipConfigVersionCheck": false,
 	"configVersion": 4
 }

+ 1 - 1
frontend/src/main.js

@@ -8,7 +8,7 @@ import store from "./store";
 
 import App from "./App.vue";
 
-const REQUIRED_CONFIG_VERSION = 4;
+const REQUIRED_CONFIG_VERSION = 5;
 
 const handleMetadata = attrs => {
 	document.title = `Musare | ${attrs.title}`;

+ 16 - 4
frontend/src/pages/Admin/tabs/Stations.vue

@@ -180,8 +180,13 @@
 		<request-song v-if="modals.requestSong" />
 		<edit-playlist v-if="modals.editPlaylist" />
 		<create-playlist v-if="modals.createPlaylist" />
-		<manage-station
-			v-if="modals.manageStation"
+		<manage-station-owen
+			v-if="modals.manageStation && manageStationVersion === 'owen'"
+			:station-id="editingStationId"
+			sector="admin"
+		/>
+		<manage-station-kris
+			v-if="modals.manageStation && manageStationVersion === 'kris'"
 			:station-id="editingStationId"
 			sector="admin"
 		/>
@@ -203,8 +208,10 @@ export default {
 		RequestSong: () => import("@/components/modals/RequestSong.vue"),
 		EditPlaylist: () => import("@/components/modals/EditPlaylist.vue"),
 		CreatePlaylist: () => import("@/components/modals/CreatePlaylist.vue"),
-		ManageStation: () =>
-			import("@/components/modals/ManageStation/index.vue"),
+		ManageStationOwen: () =>
+			import("@/components/modals/ManageStationOwen/index.vue"),
+		ManageStationKris: () =>
+			import("@/components/modals/ManageStationKris/index.vue"),
 		Report: () => import("@/components/modals/Report.vue"),
 		EditSong: () => import("@/components/modals/EditSong.vue"),
 		UserIdToUsername,
@@ -213,6 +220,7 @@ export default {
 	data() {
 		return {
 			editingStationId: "",
+			manageStationVersion: "",
 			newStation: {
 				genres: [],
 				blacklistedGenres: []
@@ -231,6 +239,10 @@ export default {
 		})
 	},
 	mounted() {
+		lofig.get("manageStationVersion", manageStationVersion => {
+			this.manageStationVersion = manageStationVersion;
+		});
+
 		if (this.socket.readyState === 1) this.init();
 		ws.onConnect(() => this.init());
 

+ 20 - 4
frontend/src/pages/Station/index.vue

@@ -558,8 +558,17 @@
 				<request-song v-if="modals.requestSong" />
 				<edit-playlist v-if="modals.editPlaylist" />
 				<create-playlist v-if="modals.createPlaylist" />
-				<manage-station
-					v-if="modals.manageStation"
+				<manage-station-owen
+					v-if="
+						modals.manageStation && manageStationVersion === 'owen'
+					"
+					:station-id="station._id"
+					sector="station"
+				/>
+				<manage-station-kris
+					v-if="
+						modals.manageStation && manageStationVersion === 'kris'
+					"
 					:station-id="station._id"
 					sector="station"
 				/>
@@ -639,8 +648,10 @@ export default {
 		RequestSong: () => import("@/components/modals/RequestSong.vue"),
 		EditPlaylist: () => import("@/components/modals/EditPlaylist.vue"),
 		CreatePlaylist: () => import("@/components/modals/CreatePlaylist.vue"),
-		ManageStation: () =>
-			import("@/components/modals/ManageStation/index.vue"),
+		ManageStationOwen: () =>
+			import("@/components/modals/ManageStationOwen/index.vue"),
+		ManageStationKris: () =>
+			import("@/components/modals/ManageStationKris/index.vue"),
 		Report: () => import("@/components/modals/Report.vue"),
 		Z404,
 		FloatingBox,
@@ -653,6 +664,7 @@ export default {
 		return {
 			utils,
 			isIOS: navigator.platform.match(/iPhone|iPod|iPad/),
+			manageStationVersion: "",
 			title: "Station",
 			loading: true,
 			exists: true,
@@ -713,6 +725,10 @@ export default {
 		})
 	},
 	async mounted() {
+		lofig.get("manageStationVersion", manageStationVersion => {
+			this.manageStationVersion = manageStationVersion;
+		});
+
 		this.editSongModalWatcher = this.$store.watch(
 			state => state.modalVisibility.modals.editSong,
 			newValue => {