mirror of
https://github.com/rustfs/console.git
synced 2026-09-18 08:46:23 +08:00
pref: bucket sort by name. rustfs/s3-rustfs#282
This commit is contained in:
@@ -127,7 +127,10 @@ const { data, refresh } = await useAsyncData(
|
||||
'buckets',
|
||||
async () => {
|
||||
const response = await listBuckets();
|
||||
return response.Buckets || [];
|
||||
// sort by creation date
|
||||
// return response.Buckets?.sort((a:any, b:any) => {return new Date(b.CreationDate).getTime() - new Date(a.CreationDate).getTime() }) || [];
|
||||
// sort by name
|
||||
return response.Buckets?.sort((a:any, b:any) => {return a.Name.localeCompare(b.Name) }) || [];
|
||||
},
|
||||
{ default: () => [] }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user