skyline/src/resources/manila/share-group.js
Jingwei.Zhang 3643ca912c feat: Update share actions && fetch
1. Add public policy check when create public share
2. Add public policy check when edit share
3. Disable actions for public share that do not belong to you
4. Remove update-time info from share detail page
5. Remove update-time info from share group detail page
6. Fix share api fetch: add is_public=true to fetch all data
7. Support share api fetch sorter
8. Support share group api fetch sorter

Change-Id: I737747086900626872df3e566f6e4f21c48893f2
2022-05-17 14:02:47 +08:00

66 lines
1.3 KiB
JavaScript

export const shareGroupStatus = {
available: t('Available'),
error: t('Error'),
creating: t('Creating'),
deleting: t('Deleting'),
};
export const getShareGroupColumns = (self) => {
return [
{
title: t('ID/Name'),
dataIndex: 'name',
routeName: self.getRouteName('shareGroupDetail'),
},
{
title: t('Project ID/Name'),
dataIndex: 'project_name',
isHideable: true,
hidden: !self.isAdminPage,
sortKey: 'project_id',
},
{
title: t('Description'),
dataIndex: 'description',
isHideable: true,
sorter: false,
},
{
title: t('Availability Zone'),
dataIndex: 'availability_zone',
sorter: false,
},
{
title: t('Share Network'),
dataIndex: 'share_network_id',
render: (value) => {
if (!value) {
return '-';
}
const link = self.getLinkRender('shareNetworkDetail', value, {
id: value,
});
return link;
},
},
{
title: t('Status'),
dataIndex: 'status',
render: (value) => shareGroupStatus[value] || value,
},
{
title: t('Created At'),
dataIndex: 'created_at',
isHideable: true,
valueRender: 'sinceTime',
},
];
};
export const shareGroupFilters = [
{
label: t('Name'),
name: 'name',
},
];