From 78e9652127eee66cce22ac55db5e2a32d10c3ae4 Mon Sep 17 00:00:00 2001
From: Jonathan Treffler
Date: Sat, 4 May 2019 16:32:42 +0200
Subject: [PATCH 1/2] added overall progress label
---
js/ng-flow-standalone.js | 12 +++++++++++-
templates/main.php | 1 +
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/js/ng-flow-standalone.js b/js/ng-flow-standalone.js
index c80610c3..1f8c1ad4 100644
--- a/js/ng-flow-standalone.js
+++ b/js/ng-flow-standalone.js
@@ -638,6 +638,16 @@
return ret;
},
+ /**
+ * Returns the count of all files
+ * @function
+ * @returns {number}
+ */
+ getFilesCount: function () {
+ var count = this.files.length;
+ return count;
+ },
+
/**
* Returns the total size of all files in bytes.
* @function
@@ -1922,4 +1932,4 @@ angular.module('flow.transfers', ['flow.init'])
};
}]);
angular.module('flow', ['flow.provider', 'flow.init', 'flow.events', 'flow.btn',
- 'flow.drop', 'flow.transfers', 'flow.img', 'flow.dragEvents']);
\ No newline at end of file
+ 'flow.drop', 'flow.transfers', 'flow.img', 'flow.dragEvents']);
diff --git a/templates/main.php b/templates/main.php
index a5e0ae68..b8ac39cd 100644
--- a/templates/main.php
+++ b/templates/main.php
@@ -17,6 +17,7 @@
= $l->t('Pause'); ?>
= $l->t('Cancel'); ?>
= $l->t('Size'); ?>: {{$flow.getSize() | bytes}}
+ = $l->t('Progress'); ?>: {{$flow.progress()*100 | number:2}}%
= $l->t('Uploading'); ?>...
From 89633d4f00381951e0e2327863664ea0e9f8c0a5 Mon Sep 17 00:00:00 2001
From: Jonathan Treffler
Date: Sun, 5 May 2019 16:42:56 +0200
Subject: [PATCH 2/2] added finished chunks counter to file size hover overlay
---
js/ng-flow-standalone.js | 18 +++++++++++++++++-
templates/main.php | 2 +-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/js/ng-flow-standalone.js b/js/ng-flow-standalone.js
index 1f8c1ad4..c8151c83 100644
--- a/js/ng-flow-standalone.js
+++ b/js/ng-flow-standalone.js
@@ -639,7 +639,7 @@
},
/**
- * Returns the count of all files
+ * Returns the count of files in the queue
* @function
* @returns {number}
*/
@@ -978,6 +978,22 @@
return this._prevProgress;
},
+ /**
+ * Get current number of complete chunks
+ * @function
+ * @returns {number} from 0 to chunks.length
+ */
+ completeChunks: function () {
+ var completeChunks = 0;
+
+ each(this.chunks, function (c) {
+ if(c.progress() === 1){
+ completeChunks++;
+ }
+ });
+ return completeChunks;
+ },
+
/**
* Indicates if file is being uploaded at the moment
* @function
diff --git a/templates/main.php b/templates/main.php
index b8ac39cd..73b1dd94 100644
--- a/templates/main.php
+++ b/templates/main.php
@@ -33,7 +33,7 @@
| {{$index+1}} |
{{file.relativePath}} |
- {{file.size*file.progress() | bytes}}/{{file.size | bytes}} |
+ {{file.size*file.progress() | bytes}}/{{file.size | bytes}} |
|