Started working on settings tab

This commit is contained in:
RemixDev 2020-04-13 20:05:26 +02:00
parent e984c5464e
commit 8b52af374c
2 changed files with 18 additions and 3 deletions

View File

@ -58,8 +58,7 @@ socket.on("startDownload", function(uuid){
})
socket.on("finishDownload", function(uuid){
console.log(uuid+" finished downloading")
toast(`${queueList[uuid].title} finished downloading.`)
toast(`${queueList[uuid].title} finished downloading.`, 'done')
$('#bar_' + uuid).css('width', '100%')
let result_icon = $('#download_'+uuid).find('.queue_icon')
if (queueList[uuid].failed == 0){
@ -74,6 +73,9 @@ socket.on("finishDownload", function(uuid){
queue.splice(index, 1)
delete queueList[uuid]
}
if (queue.length <= 0){
toast('All downloads completed!', 'all_done')
}
})
socket.on("removedAllDownloads", function(){
@ -84,7 +86,6 @@ socket.on("removedAllDownloads", function(){
socket.on("updateQueue", function(update){
if (update.uuid && queue.indexOf(update.uuid) > -1){
console.log(update)
if (update.downloaded){
queueList[update.uuid].downloaded++
$("#download_"+update.uuid+" .queue_downloaded").text(queueList[update.uuid].downloaded)

View File

@ -160,3 +160,17 @@ socket.on("logged_out", function(){
$("#settings_username").text("Not Logged")
$("#settings_picture").attr("src",`https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg`)
})
// settings
var settingsTab = new Vue({
el: '#settings_tab',
data: {
settings: {}
}
})
socket.on("init_settings", function(settings){
console.log(settings)
settingsTab.settings = settings
toast("Loaded Settings", 'done')
})