This commit is contained in:
parent
daa2d339ce
commit
81b062ca0e
@ -1,5 +1,5 @@
|
||||
{
|
||||
"backend_de": "http://localhost:31204",
|
||||
"backend_dev": "https://webplay.rocks",
|
||||
"backend_dev": "http://localhost:31204",
|
||||
"backend_de": "https://webplay.rocks",
|
||||
"backend": "https://webplay.rocks"
|
||||
}
|
@ -37,9 +37,12 @@
|
||||
}}
|
||||
</button>
|
||||
<hr />
|
||||
<button @click="shareObject">
|
||||
<button v-if="!selectedAlbum.share._id" @click="shareEnable">
|
||||
<awesome-icon icon="share" />Share this album
|
||||
</button>
|
||||
<button v-else @click="shareDisable">
|
||||
<awesome-icon icon="share" />Remove share
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</DropDown>
|
||||
@ -59,7 +62,6 @@
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<DropDown v-if="$store.getters['user/isAdministrator']">
|
||||
<button class="flat center">
|
||||
<awesome-icon icon="ellipsis-v" />
|
||||
@ -211,8 +213,11 @@ export default {
|
||||
selectAlbum(album) {
|
||||
this.$store.dispatch("albums/selectAlbum", album);
|
||||
},
|
||||
share() {
|
||||
this.$store.dispatch("albums/share", this.selectedAlbum);
|
||||
shareEnable() {
|
||||
this.$store.dispatch("albums/shareEnable", this.selectedAlbum);
|
||||
},
|
||||
shareDisable() {
|
||||
this.$store.dispatch("albums/shareDisable", this.selectedAlbum);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
|
@ -21,8 +21,7 @@
|
||||
:class="{ active: isFavourite }"
|
||||
@click="toggleFavourite"
|
||||
/>
|
||||
<div id="stats" class="z1 pa4">
|
||||
<div class="flex-row">
|
||||
<div id="stats" class="flex-row z1">
|
||||
<DropDown v-if="$store.getters['user/isAdministrator']">
|
||||
<button class="flat center" :title="visibility_text">
|
||||
<awesome-icon :icon="visibility_icon" />
|
||||
@ -38,6 +37,13 @@
|
||||
getVisibilityText(item)
|
||||
}}
|
||||
</button>
|
||||
<hr />
|
||||
<button v-if="!selectedBox.share._id" @click="shareEnable">
|
||||
<awesome-icon icon="share" />Share this box
|
||||
</button>
|
||||
<button v-else @click="shareDisable">
|
||||
<awesome-icon icon="share" />Remove share
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</DropDown>
|
||||
@ -71,7 +77,6 @@
|
||||
</DropDown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul id="videoList" class="videos">
|
||||
<li v-for="item in selectedBox.videos" :key="item._id">
|
||||
@ -168,8 +173,11 @@ export default {
|
||||
resetCover() {
|
||||
this.$store.dispatch("boxes/resetCover", this.selectedBox);
|
||||
},
|
||||
share() {
|
||||
this.$store.dispatch("boxes/share", this.selectedBox);
|
||||
shareEnable() {
|
||||
this.$store.dispatch("boxes/shareEnable", this.selectedBox);
|
||||
},
|
||||
shareDisable() {
|
||||
this.$store.dispatch("boxes/shareDisable", this.selectedBox);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
|
@ -154,11 +154,14 @@ export default {
|
||||
}
|
||||
axios.put(context.rootGetters.server + "/api/albums/" + album._id, body, context.rootGetters.headers);
|
||||
},
|
||||
share(context, album) {
|
||||
return new Promise((resolve) => {
|
||||
axios.get(context.rootGetters.server + "/api/albums/" + album._id + "/share", context.rootGetters.headers).then(res => {
|
||||
resolve(res.data);
|
||||
shareEnable(context, album) {
|
||||
axios.post(context.rootGetters.server + "/api/albums/" + album._id + "/share", {}, context.rootGetters.headers).then(res => {
|
||||
album.share = res.data;
|
||||
});
|
||||
},
|
||||
shareDisable(context, album) {
|
||||
axios.delete(context.rootGetters.server + "/api/albums/" + album._id + "/share", context.rootGetters.headers).then(() => {
|
||||
album.share = {};
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
@ -59,6 +59,7 @@ export default {
|
||||
|
||||
} else if (existsAlbum && album.tracks.length > 0) {
|
||||
existsAlbum.covers = album.covers || {};
|
||||
existsAlbum.share = album.share;
|
||||
existsAlbum.tracks = album.tracks;
|
||||
existsAlbum.tracks.forEach((track) => {
|
||||
track.parent = existsAlbum;
|
||||
|
@ -1,7 +1,7 @@
|
||||
export default {
|
||||
collection: [],
|
||||
newest: [],
|
||||
selectedAlbum: { tracks: [], covers: {} },
|
||||
selectedAlbum: { tracks: [], covers: {}, share: {} },
|
||||
page: 1,
|
||||
loading: false,
|
||||
eos: false
|
||||
|
@ -130,4 +130,14 @@ export default {
|
||||
box.covers = {}
|
||||
});
|
||||
},
|
||||
shareEnable(context, box) {
|
||||
axios.post(context.rootGetters.server + "/api/boxes/" + box._id + "/share", {}, context.rootGetters.headers).then(res => {
|
||||
box.share = res.data;
|
||||
});
|
||||
},
|
||||
shareDisable(context, box) {
|
||||
axios.delete(context.rootGetters.server + "/api/boxes/" + box._id + "/share", context.rootGetters.headers).then(() => {
|
||||
box.share = {};
|
||||
});
|
||||
}
|
||||
}
|
@ -50,6 +50,7 @@ export default {
|
||||
});
|
||||
} else if (existsBox && box.videos.length > 0) {
|
||||
existsBox.covers = box.covers || {};
|
||||
existsBox.share = box.share;
|
||||
existsBox.videos = box.videos;
|
||||
existsBox.videos.forEach((video) => {
|
||||
video.parent = existsBox;
|
||||
|
@ -1,7 +1,7 @@
|
||||
export default {
|
||||
collection: [],
|
||||
newest: [],
|
||||
selectedBox: { videos: [], covers: {} },
|
||||
selectedBox: { videos: [], covers: {}, share: {} },
|
||||
page: 1,
|
||||
loading: false,
|
||||
eos: false
|
||||
|
Loading…
Reference in New Issue
Block a user