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:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user