diff options
author | bobzel <zzzman@gmail.com> | 2023-12-02 16:21:07 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-12-02 16:21:07 -0500 |
commit | 23f789ab0bc9947f1bd23816183df2b5cc89b0e6 (patch) | |
tree | ca6f3a4af93f262aeb0544f4aff476e231b6dddb /src | |
parent | 9c7e055a2cf7ca5bc517edd3a9f44e128ec40ff3 (diff) |
changed uploading messages.
Diffstat (limited to 'src')
-rw-r--r-- | src/server/ApiManagers/UploadManager.ts | 5 | ||||
-rw-r--r-- | src/server/DashUploadUtils.ts | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/server/ApiManagers/UploadManager.ts b/src/server/ApiManagers/UploadManager.ts index 09ba2a57e..391f67bbb 100644 --- a/src/server/ApiManagers/UploadManager.ts +++ b/src/server/ApiManagers/UploadManager.ts @@ -74,12 +74,13 @@ export default class UploadManager extends ApiManager { filesize = value; } }); + fileguids.split(';').map(guid => DashUploadUtils.uploadProgress.set(guid, `upload starting`)); + form.on('progress', e => fileguids.split(';').map(guid => DashUploadUtils.uploadProgress.set(guid, `read:(${Math.round((100 * +e) / +filesize)}%) ${e} of ${filesize}`))); form.keepExtensions = true; form.uploadDir = pathToDirectory(Directory.parsed_files); return new Promise<void>(resolve => { form.parse(req, async (_err, _fields, files) => { - fileguids.split(';').map(guid => DashUploadUtils.uploadProgress.set(guid, `resampling images`)); const results: Upload.FileResponse[] = []; if (_err?.message) { results.push({ @@ -93,6 +94,8 @@ export default class UploadManager extends ApiManager { result: { name: 'failed upload', message: `${_err.message}` }, }); } + fileguids.split(';').map(guid => DashUploadUtils.uploadProgress.set(guid, `resampling images`)); + for (const key in files) { const f = files[key]; if (!Array.isArray(f)) { diff --git a/src/server/DashUploadUtils.ts b/src/server/DashUploadUtils.ts index eb6c080ef..2053ae448 100644 --- a/src/server/DashUploadUtils.ts +++ b/src/server/DashUploadUtils.ts @@ -196,7 +196,7 @@ export namespace DashUploadUtils { const isAzureOn = usingAzure(); const { type, path, name } = file; const types = type?.split('/') ?? []; - uploadProgress.set(overwriteGuid ?? name, 'uploading'); // If the client sent a guid it uses to track upload progress, use that guid. Otherwise, use the file's name. + // uploadProgress.set(overwriteGuid ?? name, 'uploading'); // If the client sent a guid it uses to track upload progress, use that guid. Otherwise, use the file's name. const category = types[0]; let format = `.${types[1]}`; |