Started working on settings tab
This commit is contained in:
parent
e984c5464e
commit
8b52af374c
@ -58,8 +58,7 @@ socket.on("startDownload", function(uuid){
|
|||||||
})
|
})
|
||||||
|
|
||||||
socket.on("finishDownload", function(uuid){
|
socket.on("finishDownload", function(uuid){
|
||||||
console.log(uuid+" finished downloading")
|
toast(`${queueList[uuid].title} finished downloading.`, 'done')
|
||||||
toast(`${queueList[uuid].title} finished downloading.`)
|
|
||||||
$('#bar_' + uuid).css('width', '100%')
|
$('#bar_' + uuid).css('width', '100%')
|
||||||
let result_icon = $('#download_'+uuid).find('.queue_icon')
|
let result_icon = $('#download_'+uuid).find('.queue_icon')
|
||||||
if (queueList[uuid].failed == 0){
|
if (queueList[uuid].failed == 0){
|
||||||
@ -74,6 +73,9 @@ socket.on("finishDownload", function(uuid){
|
|||||||
queue.splice(index, 1)
|
queue.splice(index, 1)
|
||||||
delete queueList[uuid]
|
delete queueList[uuid]
|
||||||
}
|
}
|
||||||
|
if (queue.length <= 0){
|
||||||
|
toast('All downloads completed!', 'all_done')
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
socket.on("removedAllDownloads", function(){
|
socket.on("removedAllDownloads", function(){
|
||||||
@ -84,7 +86,6 @@ socket.on("removedAllDownloads", function(){
|
|||||||
|
|
||||||
socket.on("updateQueue", function(update){
|
socket.on("updateQueue", function(update){
|
||||||
if (update.uuid && queue.indexOf(update.uuid) > -1){
|
if (update.uuid && queue.indexOf(update.uuid) > -1){
|
||||||
console.log(update)
|
|
||||||
if (update.downloaded){
|
if (update.downloaded){
|
||||||
queueList[update.uuid].downloaded++
|
queueList[update.uuid].downloaded++
|
||||||
$("#download_"+update.uuid+" .queue_downloaded").text(queueList[update.uuid].downloaded)
|
$("#download_"+update.uuid+" .queue_downloaded").text(queueList[update.uuid].downloaded)
|
||||||
|
@ -160,3 +160,17 @@ socket.on("logged_out", function(){
|
|||||||
$("#settings_username").text("Not Logged")
|
$("#settings_username").text("Not Logged")
|
||||||
$("#settings_picture").attr("src",`https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg`)
|
$("#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')
|
||||||
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user