|
@@ -47,7 +47,10 @@
|
|
|
components: { EditSong },
|
|
|
data() {
|
|
|
return {
|
|
|
+ position: 1,
|
|
|
+ maxPosition: 1,
|
|
|
songs: [],
|
|
|
+ searchQuery: '',
|
|
|
modals: { editSong: false },
|
|
|
editing: {
|
|
|
index: 0,
|
|
@@ -72,18 +75,29 @@
|
|
|
edit: function (song, index) {
|
|
|
this.$broadcast('editSong', song, index, 'songs');
|
|
|
},
|
|
|
- remove: function (id, index) {
|
|
|
+ remove: function (id) {
|
|
|
this.socket.emit('songs.remove', id, res => {
|
|
|
if (res.status == 'success') Toast.methods.addToast(res.message, 4000);
|
|
|
else Toast.methods.addToast(res.message, 8000);
|
|
|
});
|
|
|
},
|
|
|
- init: function() {
|
|
|
+ getSet: function () {
|
|
|
let _this = this;
|
|
|
- _this.socket.emit('songs.index', data => {
|
|
|
- _this.songs = data;
|
|
|
+ _this.socket.emit('songs.getSet', _this.position, data => {
|
|
|
+ data.forEach(song => {
|
|
|
+ _this.songs.push(song);
|
|
|
+ });
|
|
|
+ _this.position = _this.position + 1;
|
|
|
+ if (_this.maxPosition > _this.position - 1) _this.getSet();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ init: function () {
|
|
|
+ let _this = this;
|
|
|
+ _this.socket.emit('songs.length', length => {
|
|
|
+ _this.maxPosition = Math.round(length / 15);
|
|
|
+ _this.getSet();
|
|
|
});
|
|
|
- _this.socket.emit('apis.joinAdminRoom', 'songs', data => {});
|
|
|
+ _this.socket.emit('apis.joinAdminRoom', 'songs', () => {});
|
|
|
}
|
|
|
},
|
|
|
ready: function () {
|