mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-24 14:46:27 -08:00
quik patchin
This commit is contained in:
parent
b93fd38bcd
commit
dd0a080ba8
|
@ -71,35 +71,44 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let upload_files = () => {
|
let upload_files = async () => {
|
||||||
uploadInProgress = true
|
uploadInProgress = true
|
||||||
|
|
||||||
// go through all files
|
let sequential = localStorage.getItem("sequentialMode") == "true"
|
||||||
Object.entries(uploads).forEach(([x,v]) => {
|
|
||||||
switch(v.type) {
|
|
||||||
case "upload":
|
|
||||||
let fd = new FormData()
|
|
||||||
fd.append("file",v.file)
|
|
||||||
|
|
||||||
handle_fetch_promise(x,fetch("/upload",{
|
// go through all files
|
||||||
headers: {
|
for (let [x,v] of Object.entries(uploads)) {
|
||||||
"monofile-params": JSON.stringify(v.params)
|
// quick patch-in to allow for a switch to have everything upload sequentially
|
||||||
},
|
// switch will have a proper menu option later, for now i'm lazy so it's just gonna be a Secret
|
||||||
method: "POST",
|
let hdl = () => {
|
||||||
body: fd
|
switch(v.type) {
|
||||||
}))
|
case "upload":
|
||||||
break
|
let fd = new FormData()
|
||||||
case "clone":
|
fd.append("file",v.file)
|
||||||
handle_fetch_promise(x,fetch("/clone",{
|
|
||||||
method: "POST",
|
return handle_fetch_promise(x,fetch("/upload",{
|
||||||
body: JSON.stringify({
|
headers: {
|
||||||
url: v.url,
|
"monofile-params": JSON.stringify(v.params)
|
||||||
...v.params
|
},
|
||||||
})
|
method: "POST",
|
||||||
}))
|
body: fd
|
||||||
break
|
}))
|
||||||
|
break
|
||||||
|
case "clone":
|
||||||
|
return handle_fetch_promise(x,fetch("/clone",{
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
url: v.url,
|
||||||
|
...v.params
|
||||||
|
})
|
||||||
|
}))
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
if (sequential) await hdl();
|
||||||
|
else hdl();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// animation
|
// animation
|
||||||
|
|
Loading…
Reference in a new issue