1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 00:20:07 +00:00

[system admin] statistic/traffic: fixed sort for users/orgs traffic (#4677)

This commit is contained in:
llj
2020-09-22 14:03:58 +08:00
committed by GitHub
parent d719fc1c90
commit 7474616129
5 changed files with 81 additions and 98 deletions

View File

@@ -1042,24 +1042,6 @@ export const Utils = {
return items;
},
sortTraffic(items, sortBy, sortOrder) {
let comparator;
switch(sortOrder) {
case 'asc':
comparator = function(a, b) {
return a[sortBy] < b[sortBy] ? -1 : 1;
};
break;
case 'desc':
comparator = function(a, b) {
return a[sortBy] < b[sortBy] ? 1 : -1;
};
break;
}
items.sort(comparator);
return items;
},
/*
* only used in the 'catch' part of a seafileAPI request
*/