Skip to content
Snippets Groups Projects
Commit 8bd0a4d2 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #11954 TIME 0:30 step load converted file

parent dac9f6ed
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ if (file_exists("custom/{$customId}/src/core/lang/lang-{$language}.php")) { ...@@ -26,7 +26,7 @@ if (file_exists("custom/{$customId}/src/core/lang/lang-{$language}.php")) {
require_once("src/core/lang/lang-{$language}.php"); require_once("src/core/lang/lang-{$language}.php");
$app = new \Slim\App(['settings' => ['displayErrorDetails' => true, 'determineRouteBeforeAppMiddleware' => true, 'addContentLengthHeader' => false ]]); $app = new \Slim\App(['settings' => ['displayErrorDetails' => true, 'determineRouteBeforeAppMiddleware' => true, 'addContentLengthHeader' => true ]]);
//Authentication //Authentication
$app->add(function (\Slim\Http\Request $request, \Slim\Http\Response $response, callable $next) { $app->add(function (\Slim\Http\Request $request, \Slim\Http\Response $response, callable $next) {
......
...@@ -218,12 +218,12 @@ export class DocumentViewerComponent implements OnInit { ...@@ -218,12 +218,12 @@ export class DocumentViewerComponent implements OnInit {
switch (event.type) { switch (event.type) {
case HttpEventType.DownloadProgress: case HttpEventType.DownloadProgress:
this.loadingInfo.mode = 'indeterminate'; const downloadProgress = Math.round(100 * event.loaded / event.total);
this.loadingInfo.percent = downloadProgress;
const kbLoaded = Math.round(event.loaded / 125); this.loadingInfo.mode = 'determinate';
this.loadingInfo.message = `${this.lang.downloadConvertedFile}... ${kbLoaded} Ko`; this.loadingInfo.message = `3/3 ${this.lang.downloadConvertedFile}...`;
return { status: 'progress', message: '' }; return { status: 'progress', message: downloadProgress };
case HttpEventType.UploadProgress: case HttpEventType.UploadProgress:
const progress = Math.round(100 * event.loaded / event.total); const progress = Math.round(100 * event.loaded / event.total);
...@@ -231,10 +231,10 @@ export class DocumentViewerComponent implements OnInit { ...@@ -231,10 +231,10 @@ export class DocumentViewerComponent implements OnInit {
if (progress === 100) { if (progress === 100) {
this.loadingInfo.mode = 'indeterminate'; this.loadingInfo.mode = 'indeterminate';
this.loadingInfo.message = `${this.lang.convertingFile}...`; this.loadingInfo.message = `2/3 ${this.lang.convertingFile}...`;
} else { } else {
this.loadingInfo.mode = 'determinate'; this.loadingInfo.mode = 'determinate';
this.loadingInfo.message = `${this.lang.loadingFile}...`; this.loadingInfo.message = `1/3 ${this.lang.loadingFile}...`;
} }
return { status: 'progress', message: progress }; return { status: 'progress', message: progress };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment