mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fixes upload indicator.
Fixes max-body-size
This commit is contained in:
parent
e776afc6d2
commit
16c017716f
@ -14,7 +14,7 @@ import time
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Class&Function Defination
|
||||
MAX_STREAMED_SIZE = 1024 * 1024 * 1024
|
||||
MAX_STREAMED_SIZE = 32000
|
||||
|
||||
@tornado.web.stream_request_body
|
||||
class UploadHandler(tornado.web.RequestHandler):
|
||||
|
@ -583,17 +583,18 @@
|
||||
label: "Upload",
|
||||
className: "btn-default",
|
||||
callback: async function () {
|
||||
var height = files.files.length*50;
|
||||
|
||||
var waitMessage = '<p class="text-center mb-0">'+
|
||||
'<i class="fa fa-spin fa-cog"></i>'+
|
||||
'Please wait while we upload your files... This may take a while.<br>'+
|
||||
'<strong>DO NOT CLOSE THIS PAGE.</strong>'+
|
||||
'</p>'+
|
||||
'<div class="progress" id="upload-progress-bar-parent" style="height:'+height +'px; width:100%; display: block;">'+
|
||||
'</div>'
|
||||
files = document.getElementById("files");
|
||||
uploadWaitDialog = bootbox.dialog({
|
||||
message: `
|
||||
<p class="text-center mb-0">
|
||||
<i class="fa fa-spin fa-cog"></i>
|
||||
Please wait while we upload your files... This may take a while.<br>
|
||||
<strong>DO NOT CLOSE THIS PAGE.</strong>
|
||||
</p>
|
||||
<div class="progress" id="upload-progress-bar-parent">
|
||||
</div>
|
||||
`,
|
||||
message: waitMessage,
|
||||
closeButton: false
|
||||
});
|
||||
let nFiles = files.files.length;
|
||||
@ -603,20 +604,20 @@
|
||||
hideUploadBox();
|
||||
break;
|
||||
}
|
||||
console.log(files.files[i]);
|
||||
console.log(files.files[i].name);
|
||||
const progressHtml = `
|
||||
<div>
|
||||
${path + '/' + files.files[i]}:
|
||||
<div
|
||||
<div style="width: 100%; min-width: 100%;">
|
||||
${files.files[i].name}:
|
||||
<br><div
|
||||
id="upload-progress-bar-${i + 1}"
|
||||
class="progress-bar progress-bar-striped progress-bar-animated"
|
||||
role="progressbar"
|
||||
style="width: 0%"
|
||||
style="width: 100%; height: 10px;"
|
||||
aria-valuenow="0"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
></div>
|
||||
</div>
|
||||
</div><br>
|
||||
`;
|
||||
$('#upload-progress-bar-parent').append(progressHtml);
|
||||
sendFile(files.files[i], path, server_id, (progress) => {
|
||||
@ -753,7 +754,7 @@
|
||||
|
||||
if (webSocket) {
|
||||
webSocket.on('close_upload_box', function (close_upload_box) {
|
||||
hideUploadBox();
|
||||
//hideUploadBox();
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user