From d30de6460d16e4b98389b19f2480d07ba36ab6e9 Mon Sep 17 00:00:00 2001 From: Prakash Ranade Date: Thu, 7 Sep 2023 12:59:06 -0700 Subject: [PATCH] # This is a combination of 4 commits. # This is the 1st commit message: Adding new chunking-fileuploader template (cherry picked from commit 517072fe35143c0a3cdff507ba63659222b710f8) Change-Id: I9f80d24959a725c8a4765de7759b8114be808460 # This is the commit message #2: pop up modal close and upload job progress UI changes (cherry picked from commit f2fb733b615281369fbd228a9cd4a220659284ba) # This is the commit message #3: Fix - drag and drop functionality - the drop zone will automatically hide when the file is moved out of the dropzone area , fix file upload popup css styling, name of the file uploading will be displayed instead of static text failed. (cherry picked from commit 7d9737bff986d0c9c54cd381a098eaff16ff89a8) # This is the commit message #4: chunksize and max number of concurrent connections config support (cherry picked from commit 2cf8b9817293637ae6307228a2cd70800fd60ac0) Change-Id: I285da6c2267281d6458af30f2a1682aec63b2a85 --- apps/filebrowser/src/filebrowser/conf.py | 12 + .../templates/listdir_components.mako | 216 +- desktop/core/src/desktop/api2.py | 5 +- desktop/core/src/desktop/conf.py | 10 + .../src/desktop/js/ext/fileuploader.custom.js | 5 +- .../desktop/js/ext/fileuploader.custom.new.js | 7726 +++++++++++++++++ desktop/core/src/desktop/js/hue.js | 4 +- desktop/core/src/desktop/settings.py | 29 +- .../less/components/hue-qq-upload.less | 32 +- .../templates/global_js_constants.mako | 3 +- 10 files changed, 7952 insertions(+), 90 deletions(-) create mode 100644 desktop/core/src/desktop/js/ext/fileuploader.custom.new.js diff --git a/apps/filebrowser/src/filebrowser/conf.py b/apps/filebrowser/src/filebrowser/conf.py index 7681e984071..d4d9609ad31 100644 --- a/apps/filebrowser/src/filebrowser/conf.py +++ b/apps/filebrowser/src/filebrowser/conf.py @@ -40,6 +40,18 @@ default=None, type=str) +FILE_UPLOAD_CHUNK_SIZE = Config( + key="file_upload_chunk_size", + default=5000000, + type=int, + help=_('Configure chunk size of the chunked file uploader. Default chunk size is set to 5MB.')) + +CONCURRENT_MAX_CONNECTIONS = Config( + key="concurrent_max_connections", + default=5, + type=int, + help=_('Configure the maximum number of concurrent connections(chunks) for file uploads using the chunked file uploader.')) + def get_desktop_enable_download(): """Get desktop enable_download default""" return ENABLE_DOWNLOAD.get() diff --git a/apps/filebrowser/src/filebrowser/templates/listdir_components.mako b/apps/filebrowser/src/filebrowser/templates/listdir_components.mako index 7f496538039..a100cb8fb50 100644 --- a/apps/filebrowser/src/filebrowser/templates/listdir_components.mako +++ b/apps/filebrowser/src/filebrowser/templates/listdir_components.mako @@ -22,7 +22,7 @@ from django.template.defaultfilters import urlencode, stringformat, filesizeform from desktop.lib.django_util import reverse_with_get, extract_field_data from django.utils.encoding import smart_str -from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE +from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE, FILE_UPLOAD_CHUNK_SIZE, CONCURRENT_MAX_CONNECTIONS if sys.version_info[0] > 2: from django.utils.translation import gettext as _ @@ -698,6 +698,31 @@ else: + +