mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-31 12:56:11 +01:00
Fixes upload indicator
Fixes max-body size
This commit is contained in:
parent
16c017716f
commit
3fbf4e6252
@ -14,7 +14,7 @@ import time
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Class&Function Defination
|
# Class&Function Defination
|
||||||
MAX_STREAMED_SIZE = 32000
|
MAX_STREAMED_SIZE = 1024 * 1024 * 1024
|
||||||
|
|
||||||
@tornado.web.stream_request_body
|
@tornado.web.stream_request_body
|
||||||
class UploadHandler(tornado.web.RequestHandler):
|
class UploadHandler(tornado.web.RequestHandler):
|
||||||
|
@ -583,18 +583,17 @@
|
|||||||
label: "Upload",
|
label: "Upload",
|
||||||
className: "btn-default",
|
className: "btn-default",
|
||||||
callback: async function () {
|
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");
|
files = document.getElementById("files");
|
||||||
uploadWaitDialog = bootbox.dialog({
|
uploadWaitDialog = bootbox.dialog({
|
||||||
message: waitMessage,
|
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>
|
||||||
|
`,
|
||||||
closeButton: false
|
closeButton: false
|
||||||
});
|
});
|
||||||
let nFiles = files.files.length;
|
let nFiles = files.files.length;
|
||||||
@ -604,20 +603,20 @@
|
|||||||
hideUploadBox();
|
hideUploadBox();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
console.log(files.files[i].name);
|
console.log(files.files[i]);
|
||||||
const progressHtml = `
|
const progressHtml = `
|
||||||
<div style="width: 100%; min-width: 100%;">
|
<div>
|
||||||
${files.files[i].name}:
|
${path + '/' + files.files[i]}:
|
||||||
<br><div
|
<div
|
||||||
id="upload-progress-bar-${i + 1}"
|
id="upload-progress-bar-${i + 1}"
|
||||||
class="progress-bar progress-bar-striped progress-bar-animated"
|
class="progress-bar progress-bar-striped progress-bar-animated"
|
||||||
role="progressbar"
|
role="progressbar"
|
||||||
style="width: 100%; height: 10px;"
|
style="width: 0%"
|
||||||
aria-valuenow="0"
|
aria-valuenow="0"
|
||||||
aria-valuemin="0"
|
aria-valuemin="0"
|
||||||
aria-valuemax="100"
|
aria-valuemax="100"
|
||||||
></div>
|
></div>
|
||||||
</div><br>
|
</div>
|
||||||
`;
|
`;
|
||||||
$('#upload-progress-bar-parent').append(progressHtml);
|
$('#upload-progress-bar-parent').append(progressHtml);
|
||||||
sendFile(files.files[i], path, server_id, (progress) => {
|
sendFile(files.files[i], path, server_id, (progress) => {
|
||||||
@ -754,7 +753,7 @@
|
|||||||
|
|
||||||
if (webSocket) {
|
if (webSocket) {
|
||||||
webSocket.on('close_upload_box', function (close_upload_box) {
|
webSocket.on('close_upload_box', function (close_upload_box) {
|
||||||
//hideUploadBox();
|
hideUploadBox();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user