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

System management statistics function reconstruction (#4243)

* System management statistics function reconstruction

* translation update

* optimizated code

* Replace date component

* Modify component language

* add sort function

* optimizated code

* optimizated code
This commit is contained in:
zxj96
2019-11-13 17:13:48 +08:00
committed by Daniel Pan
parent 3791a4653e
commit fe0940e4c4
21 changed files with 1636 additions and 15 deletions

View File

@@ -962,6 +962,24 @@ 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
*/