Fix logic in bedrock server import frontend

This commit is contained in:
= 2024-09-14 13:02:19 -04:00
parent d145dd595b
commit 1f5ff5dd5a

View File

@ -498,24 +498,19 @@
<script src="../../static/assets/js/shared/upload.js"></script> <script src="../../static/assets/js/shared/upload.js"></script>
<script> <script>
document.getElementById("root_upload_button").addEventListener("click", function (event) { document.getElementById("root_upload_button").addEventListener("click", function (event) {
if (file) { if (document.getElementById('root_upload_button').classList.contains('clicked')) {
upload = true; show_file_tree();
if (document.getElementById('root_upload_button').classList.contains('clicked')) { return;
document.getElementById('main-tree-div-upload').innerHTML = '<input type="radio" class="root-input" id="main-tree-input-upload" name="root_path" value="" checked><span id="main-tree-upload" class="files-tree-title tree-caret-down root-dir"><i class="far fa-folder"></i><i class="far fa-folder-open"></i>{{ translate("serverFiles", "files", data["lang"]) }}</span></input>'
} else {
document.getElementById('root_upload_button').classList.add('clicked')
}
const token = getCookie("_xsrf");
var dialog = bootbox.dialog({
message: '<p class="text-center mb-0"><i class="fa fa-spin fa-cog"></i> Please wait while we gather your files...</p>',
closeButton: false
});
setTimeout(function () {
getDirView();
}, 2000);
} else { } else {
bootbox.alert("You must input a path before selecting this button"); document.getElementById('root_upload_button').classList.add('clicked')
} }
bootbox.dialog({
message: '<p class="text-center mb-0"><i class="fa fa-spin fa-cog"></i> Please wait while we gather your files...</p>',
closeButton: false
});
setTimeout(function () {
getDirView();
}, 2000);
}); });
function eula_confirm() { function eula_confirm() {