mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix error on upload
This commit is contained in:
parent
95ef72d809
commit
a9c9598ad0
@ -55,8 +55,15 @@ async function uploadFile(type) {
|
|||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.status === "completed") {
|
if (data.status === "completed") {
|
||||||
$("#upload_input").html(`<div class="card-header header-sm d-flex justify-content-between align-items-center" style="width: 100%;"><input value="${file.name}" type="text" id="file-uploaded" disabled></input> 🔒</div>`);
|
$("#upload_input").html(`<div class="card-header header-sm d-flex justify-content-between align-items-center" style="width: 100%;"><input value="${file.name}" type="text" id="file-uploaded" disabled></input> 🔒</div>`);
|
||||||
|
if (type === "import") {
|
||||||
document.getElementById("lower_half").style.visibility = "visible";
|
document.getElementById("lower_half").style.visibility = "visible";
|
||||||
document.getElementById("lower_half").hidden = false;
|
document.getElementById("lower_half").hidden = false;
|
||||||
|
} else if (type === "background") {
|
||||||
|
setTimeout(function () {
|
||||||
|
location.href = `/panel/custom_login`
|
||||||
|
}, 2000)
|
||||||
|
|
||||||
|
}
|
||||||
} else if (data.status !== "partial") {
|
} else if (data.status !== "partial") {
|
||||||
throw new Error(data.message);
|
throw new Error(data.message);
|
||||||
}
|
}
|
||||||
@ -71,7 +78,7 @@ async function uploadFile(type) {
|
|||||||
try {
|
try {
|
||||||
await Promise.all(uploadPromises);
|
await Promise.all(uploadPromises);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
alert("Error uploading file: " + error.message);
|
bootbox.alert("Error uploading file: " + error.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user