fix: adjust the paging and sorting modes of the port forwarding page

1. Adjust the port forwarding page from the back-end page to the front-end page
2. Adjust the port forwarding page sort from the back-end to the front-end

Change-Id: I69864057ed903dbf58135ca6067df7b6eb7cf474
This commit is contained in:
Jingwei.Zhang 2022-08-29 11:17:49 +08:00
parent 62fcb1d585
commit 371810bc94
2 changed files with 4 additions and 26 deletions

View File

@ -33,7 +33,7 @@ export class PortForwarding extends Base {
return t('port forwardings'); return t('port forwardings');
} }
updateFetchParamsByPage = (params) => { updateFetchParams = (params) => {
const { id, all_projects, ...rest } = params; const { id, all_projects, ...rest } = params;
return { return {
fipId: id, fipId: id,
@ -43,19 +43,7 @@ export class PortForwarding extends Base {
}; };
get isFilterByBackend() { get isFilterByBackend() {
return true; return false;
}
get isSortByBackend() {
return true;
}
get defaultSortKey() {
return 'external_port';
}
get defaultSortOrder() {
return 'ascend';
} }
get actionConfigs() { get actionConfigs() {
@ -80,13 +68,11 @@ export class PortForwarding extends Base {
title: t('Internal Ip Address'), title: t('Internal Ip Address'),
dataIndex: 'internal_ip_address', dataIndex: 'internal_ip_address',
isHideable: true, isHideable: true,
sorter: false,
}, },
{ {
title: t('Internal Port/Port Range'), title: t('Internal Port/Port Range'),
dataIndex: 'internal_port', dataIndex: 'internal_port',
isHideable: true, isHideable: true,
sorter: false,
render: (value, record) => { render: (value, record) => {
return value || record.internal_port_range; return value || record.internal_port_range;
}, },
@ -100,7 +86,6 @@ export class PortForwarding extends Base {
{ {
title: t('Description'), title: t('Description'),
dataIndex: 'description', dataIndex: 'description',
sorter: false,
isHideable: true, isHideable: true,
}, },
]; ];

View File

@ -26,22 +26,15 @@ export class PortForwardingStore extends Base {
return true; return true;
} }
getFatherResourceId = (params) => params.fipId; getFatherResourceId = (params) => (params || {}).fipId;
get paramsFuncPage() { get paramsFunc() {
return (params) => { return (params) => {
const { fipId, fipInfo, current, ...rest } = params; const { fipId, fipInfo, current, ...rest } = params;
return rest; return rest;
}; };
} }
updateParamsSortPage = (params, sortKey, sortOrder) => {
if (sortKey && sortOrder) {
params.sort_key = sortKey;
params.sort_dir = sortOrder === 'descend' ? 'desc' : 'asc';
}
};
listDidFetch(items, allProjects, filters) { listDidFetch(items, allProjects, filters) {
if (items.length === 0) { if (items.length === 0) {
return items; return items;