Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"@flowjs/flow.js": "^2.14.0",
"@nextcloud/vue": "^2.0.0",
"nextcloud-l10n": "^0.1.1",
"vue": "^2.6.11"
"vue": "^2.6.11",
"vue-multiselect": "^2.1.6"
},
"browserslist": [
"extends @nextcloud/browserslist-config"
Expand Down
18 changes: 12 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
</tr>
</thead>
<tbody>
<tr v-if="!(file.isComplete() && hideFinished)" v-for="(file, index) in filteredFiles">
<tr v-for="(file, index) in filteredFiles">
<td class="hideOnMobile">{{index+1}}</td>
<td class="ellipsis" v-bind:title="'UID: ' + file.uniqueIdentifier">
<span>{{file.relativePath}}</span>
Expand Down Expand Up @@ -463,10 +463,16 @@ export default {
var self = this;

if (this.activeLocation.flow) {
let sorted;
let sorted = this.activeLocation.flow.files;

if(this.hideFinished) {
sorted = sorted.filter(function(file) {
return !(file.isComplete() && !file.error);
});
}

if (this.sort == "name") {
sorted = this.activeLocation.flow.files.sort(function(a, b) {
sorted = sorted.sort(function(a, b) {
console.log(a);
var nameA = a.relativePath.toLowerCase(),
nameB = b.relativePath.toLowerCase()
Expand All @@ -477,15 +483,15 @@ export default {
return 0 //default return value (no sorting)
});
} else if (this.sort == "size") {
sorted = this.activeLocation.flow.files.sort(function(a, b) {
sorted = sorted.sort(function(a, b) {
return b.size - a.size
});
} else if (this.sort == "progress") {
sorted = this.activeLocation.flow.files.sort(function(a, b) {
sorted = sorted.sort(function(a, b) {
return b.progress() - a.progress()
});
} else if (this.sort == "uploadspeed") {
sorted = this.activeLocation.flow.files.sort(function(a, b) {
sorted = sorted.sort(function(a, b) {
return b.averageSpeed - a.averageSpeed
});
}
Expand Down