From 16c017716fdcecb2703e80bec1b0fb7bee00dd10 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 23 Aug 2021 17:37:09 -0400 Subject: [PATCH 1/2] Fixes upload indicator. Fixes max-body-size --- app/classes/web/upload_handler.py | 2 +- .../templates/panel/server_files.html | 33 ++++++++++--------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/app/classes/web/upload_handler.py b/app/classes/web/upload_handler.py index 0d9e00e5..2273bd11 100644 --- a/app/classes/web/upload_handler.py +++ b/app/classes/web/upload_handler.py @@ -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): diff --git a/app/frontend/templates/panel/server_files.html b/app/frontend/templates/panel/server_files.html index 24476d5c..0538bb40 100644 --- a/app/frontend/templates/panel/server_files.html +++ b/app/frontend/templates/panel/server_files.html @@ -583,17 +583,18 @@ label: "Upload", className: "btn-default", callback: async function () { + var height = files.files.length*50; + + var waitMessage = '

'+ + ''+ + 'Please wait while we upload your files... This may take a while.
'+ + 'DO NOT CLOSE THIS PAGE.'+ + '

'+ + '
'+ + '
' files = document.getElementById("files"); uploadWaitDialog = bootbox.dialog({ - message: ` -

- - Please wait while we upload your files... This may take a while.
- DO NOT CLOSE THIS PAGE. -

-
-
- `, + 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 = ` -
- ${path + '/' + files.files[i]}: -
+ ${files.files[i].name}: +
-
+

`; $('#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(); }); } From 3fbf4e6252742402ae6a146fc0e94b4e0e57ea82 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 23 Aug 2021 17:40:14 -0400 Subject: [PATCH 2/2] Fixes upload indicator Fixes max-body size --- app/classes/web/upload_handler.py | 2 +- .../templates/panel/server_files.html | 33 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/app/classes/web/upload_handler.py b/app/classes/web/upload_handler.py index 2273bd11..0d9e00e5 100644 --- a/app/classes/web/upload_handler.py +++ b/app/classes/web/upload_handler.py @@ -14,7 +14,7 @@ import time logger = logging.getLogger(__name__) # Class&Function Defination -MAX_STREAMED_SIZE = 32000 +MAX_STREAMED_SIZE = 1024 * 1024 * 1024 @tornado.web.stream_request_body class UploadHandler(tornado.web.RequestHandler): diff --git a/app/frontend/templates/panel/server_files.html b/app/frontend/templates/panel/server_files.html index 0538bb40..24476d5c 100644 --- a/app/frontend/templates/panel/server_files.html +++ b/app/frontend/templates/panel/server_files.html @@ -583,18 +583,17 @@ label: "Upload", className: "btn-default", callback: async function () { - var height = files.files.length*50; - - var waitMessage = '

'+ - ''+ - 'Please wait while we upload your files... This may take a while.
'+ - 'DO NOT CLOSE THIS PAGE.'+ - '

'+ - '
'+ - '
' files = document.getElementById("files"); uploadWaitDialog = bootbox.dialog({ - message: waitMessage, + message: ` +

+ + Please wait while we upload your files... This may take a while.
+ DO NOT CLOSE THIS PAGE. +

+
+
+ `, closeButton: false }); let nFiles = files.files.length; @@ -604,20 +603,20 @@ hideUploadBox(); break; } - console.log(files.files[i].name); + console.log(files.files[i]); const progressHtml = ` -
- ${files.files[i].name}: -
+ ${path + '/' + files.files[i]}: +
-

+
`; $('#upload-progress-bar-parent').append(progressHtml); sendFile(files.files[i], path, server_id, (progress) => { @@ -754,7 +753,7 @@ if (webSocket) { webSocket.on('close_upload_box', function (close_upload_box) { - //hideUploadBox(); + hideUploadBox(); }); }