Merge "refactor: optimize the rendering of data with map values"
This commit is contained in:
commit
506055cbba
@ -19,6 +19,7 @@ import { has, get, isNumber } from 'lodash';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { renderFilterMap } from 'utils/index';
|
import { renderFilterMap } from 'utils/index';
|
||||||
|
import { getValueMapRender } from 'utils/table';
|
||||||
import Status from 'components/Status';
|
import Status from 'components/Status';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
@ -46,7 +47,8 @@ const getContentValue = (value, dataIndex, data, copyable) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getContent = (data, option) => {
|
const getContent = (data, option) => {
|
||||||
const { content, dataIndex, render, valueRender, copyable } = option;
|
const { content, dataIndex, render, valueRender, copyable, valueMap } =
|
||||||
|
option;
|
||||||
if (has(option, 'content')) {
|
if (has(option, 'content')) {
|
||||||
return copyable ? (
|
return copyable ? (
|
||||||
<Paragraph copyable={copyable}>{content}</Paragraph>
|
<Paragraph copyable={copyable}>{content}</Paragraph>
|
||||||
@ -59,6 +61,8 @@ const getContent = (data, option) => {
|
|||||||
if (valueRender) {
|
if (valueRender) {
|
||||||
const renderFunc = renderFilterMap[valueRender];
|
const renderFunc = renderFilterMap[valueRender];
|
||||||
value = renderFunc && renderFunc(value);
|
value = renderFunc && renderFunc(value);
|
||||||
|
} else if (valueMap) {
|
||||||
|
value = getValueMapRender(option)(value);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value = render(value, data);
|
value = render(value, data);
|
||||||
|
@ -41,6 +41,7 @@ import {
|
|||||||
getNameRenderByRouter,
|
getNameRenderByRouter,
|
||||||
getNameRender,
|
getNameRender,
|
||||||
columnRender,
|
columnRender,
|
||||||
|
getValueMapRender,
|
||||||
} from 'utils/table';
|
} from 'utils/table';
|
||||||
import { getNoValue } from 'utils/index';
|
import { getNoValue } from 'utils/index';
|
||||||
import { getLocalStorageItem, setLocalStorageItem } from 'utils/local-storage';
|
import { getLocalStorageItem, setLocalStorageItem } from 'utils/local-storage';
|
||||||
@ -416,12 +417,16 @@ export class BaseTable extends React.Component {
|
|||||||
routeName,
|
routeName,
|
||||||
linkPrefix,
|
linkPrefix,
|
||||||
isPrice,
|
isPrice,
|
||||||
|
valueMap,
|
||||||
...rest
|
...rest
|
||||||
} = column;
|
} = column;
|
||||||
const newSorter = getColumnSorter(column, this.props);
|
const newSorter = getColumnSorter(column, this.props);
|
||||||
const newSortOrder =
|
const newSortOrder =
|
||||||
sortOrder || newSorter ? getSortOrder(dataIndex, this.props) : null;
|
sortOrder || newSorter ? getSortOrder(dataIndex, this.props) : null;
|
||||||
let newRender = render || getRender(valueRender);
|
let newRender = render || getRender(valueRender);
|
||||||
|
if (valueMap) {
|
||||||
|
newRender = getValueMapRender(column);
|
||||||
|
}
|
||||||
if (checkIsStatusColumn(dataIndex, isStatus)) {
|
if (checkIsStatusColumn(dataIndex, isStatus)) {
|
||||||
newRender = getStatusRender(newRender);
|
newRender = getStatusRender(newRender);
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ import {
|
|||||||
getRender,
|
getRender,
|
||||||
getNameRender,
|
getNameRender,
|
||||||
getNameRenderByRouter,
|
getNameRenderByRouter,
|
||||||
|
getValueMapRender,
|
||||||
} from 'utils/table';
|
} from 'utils/table';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { getNoValue } from 'utils/index';
|
import { getNoValue } from 'utils/index';
|
||||||
@ -85,6 +86,7 @@ export default class SimpleTable extends React.Component {
|
|||||||
isLink,
|
isLink,
|
||||||
routeName,
|
routeName,
|
||||||
linkPrefix,
|
linkPrefix,
|
||||||
|
valueMap,
|
||||||
...rest
|
...rest
|
||||||
} = column;
|
} = column;
|
||||||
if (column.key === 'operation') {
|
if (column.key === 'operation') {
|
||||||
@ -94,6 +96,9 @@ export default class SimpleTable extends React.Component {
|
|||||||
const newSortOrder =
|
const newSortOrder =
|
||||||
sortOrder || newSorter ? getSortOrder(dataIndex, this.props) : null;
|
sortOrder || newSorter ? getSortOrder(dataIndex, this.props) : null;
|
||||||
let newRender = render || getRender(valueRender);
|
let newRender = render || getRender(valueRender);
|
||||||
|
if (valueMap) {
|
||||||
|
newRender = getValueMapRender(column);
|
||||||
|
}
|
||||||
if (checkIsStatusColumn(dataIndex, isStatus)) {
|
if (checkIsStatusColumn(dataIndex, isStatus)) {
|
||||||
newRender = getStatusRender(newRender);
|
newRender = getStatusRender(newRender);
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import checkItemPolicy from 'resources/skyline/policy';
|
|||||||
import ItemActionButtons from 'components/Tables/Base/ItemActionButtons';
|
import ItemActionButtons from 'components/Tables/Base/ItemActionButtons';
|
||||||
import { emptyActionConfig } from 'utils/constants';
|
import { emptyActionConfig } from 'utils/constants';
|
||||||
import { getPath, getLinkRender } from 'utils/route-map';
|
import { getPath, getLinkRender } from 'utils/route-map';
|
||||||
|
import { getValueMapRender } from 'utils/table';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
export default class DetailBase extends React.Component {
|
export default class DetailBase extends React.Component {
|
||||||
@ -230,19 +231,22 @@ export default class DetailBase extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
getDesc = (data, dataConf) => {
|
getDesc = (data, dataConf) => {
|
||||||
const { dataIndex, render, valueRender } = dataConf;
|
const { dataIndex, render, valueRender, valueMap } = dataConf;
|
||||||
|
const value = get(data, dataIndex);
|
||||||
if (render) {
|
if (render) {
|
||||||
return render(data[dataIndex], data);
|
return render(value, data);
|
||||||
}
|
}
|
||||||
if (valueRender) {
|
if (valueRender) {
|
||||||
const renderFunc = renderFilterMap[valueRender];
|
const renderFunc = renderFilterMap[valueRender];
|
||||||
return renderFunc && renderFunc(data[dataIndex]);
|
return renderFunc && renderFunc(value);
|
||||||
}
|
}
|
||||||
const desc = get(data, dataIndex);
|
if (valueMap) {
|
||||||
if (desc === undefined || desc === '') {
|
return getValueMapRender(dataConf)(value);
|
||||||
|
}
|
||||||
|
if (value === undefined || value === '') {
|
||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
return desc;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
getActionData() {
|
getActionData() {
|
||||||
|
@ -52,12 +52,12 @@ export class Detail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Power State'),
|
title: t('Power State'),
|
||||||
dataIndex: 'power_state',
|
dataIndex: 'power_state',
|
||||||
render: (value) => powerState[value] || value,
|
valueMap: powerState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Provision State'),
|
title: t('Provision State'),
|
||||||
dataIndex: 'provision_state',
|
dataIndex: 'provision_state',
|
||||||
render: (value) => provisioningState[value] || value,
|
valueMap: provisioningState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Maintained'),
|
title: t('Maintained'),
|
||||||
|
@ -66,12 +66,12 @@ export class BareMetalNode extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Power State'),
|
title: t('Power State'),
|
||||||
dataIndex: 'power_state',
|
dataIndex: 'power_state',
|
||||||
render: (value) => powerState[value] || value,
|
valueMap: powerState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Provision State'),
|
title: t('Provision State'),
|
||||||
dataIndex: 'provision_state',
|
dataIndex: 'provision_state',
|
||||||
render: (value) => provisioningState[value] || value,
|
valueMap: provisioningState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Maintained'),
|
title: t('Maintained'),
|
||||||
|
@ -227,17 +227,17 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('CPU Policy'),
|
label: t('CPU Policy'),
|
||||||
dataIndex: 'hw:cpu_policy',
|
dataIndex: 'hw:cpu_policy',
|
||||||
render: (value) => cpuPolicyList[value] || value,
|
valueMap: cpuPolicyList,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('CPU Thread Policy'),
|
label: t('CPU Thread Policy'),
|
||||||
dataIndex: 'hw:cpu_thread_policy',
|
dataIndex: 'hw:cpu_thread_policy',
|
||||||
render: (value) => cpuThreadPolicyMap[value] || value,
|
valueMap: cpuThreadPolicyMap,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Memory Page Size'),
|
label: t('Memory Page Size'),
|
||||||
dataIndex: 'hw:mem_page_size',
|
dataIndex: 'hw:mem_page_size',
|
||||||
render: (value) => pageTypeMap[value] || value,
|
valueMap: pageTypeMap,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const options = [...numa, ...others];
|
const options = [...numa, ...others];
|
||||||
|
@ -48,12 +48,12 @@ export class Detail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Architecture'),
|
title: t('Architecture'),
|
||||||
dataIndex: 'architecture',
|
dataIndex: 'architecture',
|
||||||
render: (value) => flavorArchitectures[value] || value,
|
valueMap: flavorArchitectures,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Category'),
|
title: t('Category'),
|
||||||
dataIndex: 'category',
|
dataIndex: 'category',
|
||||||
render: (value) => flavorCategoryList[value] || value,
|
valueMap: flavorCategoryList,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('CPU'),
|
title: t('CPU'),
|
||||||
|
@ -109,7 +109,7 @@ export class ManageHost extends ModalAction {
|
|||||||
title: t('Admin Status'),
|
title: t('Admin Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => serviceStatus[value] || value,
|
valueMap: serviceStatus,
|
||||||
tip: (value, record) => {
|
tip: (value, record) => {
|
||||||
const { disabled_reason } = record || {};
|
const { disabled_reason } = record || {};
|
||||||
if (disabled_reason) {
|
if (disabled_reason) {
|
||||||
@ -122,7 +122,7 @@ export class ManageHost extends ModalAction {
|
|||||||
title: t('State'),
|
title: t('State'),
|
||||||
dataIndex: 'state',
|
dataIndex: 'state',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => serviceState[value] || value,
|
valueMap: serviceState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Last Updated'),
|
title: t('Last Updated'),
|
||||||
|
@ -61,7 +61,7 @@ export class ComputeHost extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Service Status'),
|
title: t('Service Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => serviceStatus[value] || value,
|
valueMap: serviceStatus,
|
||||||
tip: (value, record) => {
|
tip: (value, record) => {
|
||||||
const { disabled_reason } = record || {};
|
const { disabled_reason } = record || {};
|
||||||
if (disabled_reason) {
|
if (disabled_reason) {
|
||||||
@ -73,7 +73,7 @@ export class ComputeHost extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Service State'),
|
title: t('Service State'),
|
||||||
dataIndex: 'state',
|
dataIndex: 'state',
|
||||||
render: (value) => serviceState[value] || value,
|
valueMap: serviceState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Last Updated'),
|
title: t('Last Updated'),
|
||||||
|
@ -60,7 +60,7 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('OS'),
|
label: t('OS'),
|
||||||
dataIndex: 'os_distro',
|
dataIndex: 'os_distro',
|
||||||
render: (value) => imageOS[value] || value,
|
valueMap: imageOS,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('OS Version'),
|
label: t('OS Version'),
|
||||||
@ -93,7 +93,7 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('Visibility'),
|
label: t('Visibility'),
|
||||||
dataIndex: 'visibility',
|
dataIndex: 'visibility',
|
||||||
render: (value) => imageVisibility[value] || value,
|
valueMap: imageVisibility,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Protected'),
|
label: t('Protected'),
|
||||||
|
@ -61,7 +61,7 @@ export class ImageDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (data) => imageStatus[data] || '-',
|
valueMap: imageStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Project ID'),
|
title: t('Project ID'),
|
||||||
|
@ -138,7 +138,7 @@ export class Image extends Base {
|
|||||||
title: t('Use Type'),
|
title: t('Use Type'),
|
||||||
dataIndex: 'usage_type',
|
dataIndex: 'usage_type',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => imageUsage[value] || value,
|
valueMap: imageUsage,
|
||||||
sorter: false,
|
sorter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -152,19 +152,19 @@ export class Image extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => imageStatus[value] || value,
|
valueMap: imageStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Visibility'),
|
title: t('Visibility'),
|
||||||
dataIndex: 'visibility',
|
dataIndex: 'visibility',
|
||||||
render: (value) => imageVisibility[value] || value,
|
valueMap: imageVisibility,
|
||||||
sorter: false,
|
sorter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Disk Format'),
|
title: t('Disk Format'),
|
||||||
dataIndex: 'disk_format',
|
dataIndex: 'disk_format',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => imageFormats[value] || value,
|
valueMap: imageFormats,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Size'),
|
title: t('Size'),
|
||||||
|
@ -91,7 +91,7 @@ export class InstanceDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (data) => instanceStatus[data] || data,
|
valueMap: instanceStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Lock Status'),
|
title: t('Lock Status'),
|
||||||
|
@ -118,7 +118,7 @@ export class DetachInterface extends ModalAction {
|
|||||||
{
|
{
|
||||||
title: t('State'),
|
title: t('State'),
|
||||||
dataIndex: 'port_state',
|
dataIndex: 'port_state',
|
||||||
render: (value) => portStatus[value] || value,
|
valueMap: portStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Mac Address'),
|
title: t('Mac Address'),
|
||||||
|
@ -105,7 +105,7 @@ export class DetachVolume extends ModalAction {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => volumeStatus[value] || value,
|
valueMap: volumeStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Type'),
|
title: t('Type'),
|
||||||
|
@ -483,7 +483,7 @@ export class BaseStep extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Disk Format'),
|
title: t('Disk Format'),
|
||||||
dataIndex: 'disk_format',
|
dataIndex: 'disk_format',
|
||||||
render: (value) => imageFormats[value] || value,
|
valueMap: imageFormats,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Min System Disk'),
|
title: t('Min System Disk'),
|
||||||
@ -498,7 +498,7 @@ export class BaseStep extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => imageStatus[value] || value,
|
valueMap: imageStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
@ -524,7 +524,7 @@ export class BaseStep extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => volumeStatus[value] || value,
|
valueMap: volumeStatus,
|
||||||
width: 80,
|
width: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -408,7 +408,7 @@ export class SystemStep extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Policy'),
|
title: t('Policy'),
|
||||||
dataIndex: 'policy',
|
dataIndex: 'policy',
|
||||||
render: (value) => policyType[value] || value,
|
valueMap: policyType,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
filterParams: [
|
filterParams: [
|
||||||
|
@ -52,7 +52,7 @@ export class ServerGroupDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Policy'),
|
title: t('Policy'),
|
||||||
dataIndex: 'policy',
|
dataIndex: 'policy',
|
||||||
render: (value) => policyType[value] || value,
|
valueMap: policyType,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Member Count'),
|
title: t('Member Count'),
|
||||||
|
@ -60,7 +60,7 @@ export class ServerGroup extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Policy'),
|
title: t('Policy'),
|
||||||
dataIndex: 'policy',
|
dataIndex: 'policy',
|
||||||
render: (value) => policyType[value] || value,
|
valueMap: policyType,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ export class CinderService extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Service Status'),
|
title: t('Service Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => serviceStatus[value] || value,
|
valueMap: serviceStatus,
|
||||||
tip: (value, record) => {
|
tip: (value, record) => {
|
||||||
if (value === 'enabled') {
|
if (value === 'enabled') {
|
||||||
return '';
|
return '';
|
||||||
@ -77,7 +77,7 @@ export class CinderService extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Service State'),
|
title: t('Service State'),
|
||||||
dataIndex: 'state',
|
dataIndex: 'state',
|
||||||
render: (value) => serviceState[value] || value,
|
valueMap: serviceState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Last Updated'),
|
title: t('Last Updated'),
|
||||||
|
@ -62,7 +62,7 @@ export class ComputeService extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Service Status'),
|
title: t('Service Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => serviceStatus[value] || value,
|
valueMap: serviceStatus,
|
||||||
tip: (value, record) => {
|
tip: (value, record) => {
|
||||||
const { disabled_reason } = record || {};
|
const { disabled_reason } = record || {};
|
||||||
if (disabled_reason) {
|
if (disabled_reason) {
|
||||||
@ -74,7 +74,7 @@ export class ComputeService extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Service State'),
|
title: t('Service State'),
|
||||||
dataIndex: 'state',
|
dataIndex: 'state',
|
||||||
render: (value) => serviceState[value] || value,
|
valueMap: serviceState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Last Updated'),
|
title: t('Last Updated'),
|
||||||
|
@ -57,7 +57,7 @@ export class HeatService extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => serviceState[value] || value,
|
valueMap: serviceState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Last Updated'),
|
title: t('Last Updated'),
|
||||||
|
@ -60,7 +60,7 @@ export class ClustersDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => clusterStatus[value] || value,
|
valueMap: clusterStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Status Reason'),
|
title: t('Status Reason'),
|
||||||
@ -69,7 +69,7 @@ export class ClustersDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Health Status'),
|
title: t('Health Status'),
|
||||||
dataIndex: 'health_status',
|
dataIndex: 'health_status',
|
||||||
render: (value) => healthStatus[value] || value || '-',
|
valueMap: healthStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Health Status Reason'),
|
title: t('Health Status Reason'),
|
||||||
|
@ -46,13 +46,13 @@ export class Clusters extends Base {
|
|||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => clusterStatus[value] || value,
|
valueMap: clusterStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Health Status'),
|
title: t('Health Status'),
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
dataIndex: 'health_status',
|
dataIndex: 'health_status',
|
||||||
render: (value) => healthStatus[value] || value || '-',
|
valueMap: healthStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Keypair'),
|
title: t('Keypair'),
|
||||||
|
@ -44,7 +44,7 @@ export class CapsulesDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => capsuleStatus[value] || value,
|
valueMap: capsuleStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -48,7 +48,7 @@ export class Capsules extends Base {
|
|||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => capsuleStatus[value] || value,
|
valueMap: capsuleStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('CPU'),
|
title: t('CPU'),
|
||||||
|
@ -38,7 +38,7 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('Status Detail'),
|
label: t('Status Detail'),
|
||||||
dataIndex: 'status_detail',
|
dataIndex: 'status_detail',
|
||||||
render: (value) => containerStatus[value] || value,
|
valueMap: containerStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Status Reason'),
|
label: t('Status Reason'),
|
||||||
|
@ -53,7 +53,7 @@ export class ContainerDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => containerStatus[value] || value,
|
valueMap: containerStatus,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ export class Containers extends Base {
|
|||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => containerStatus[value] || value,
|
valueMap: containerStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Image'),
|
title: t('Image'),
|
||||||
@ -66,7 +66,7 @@ export class Containers extends Base {
|
|||||||
title: t('Task State'),
|
title: t('Task State'),
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
dataIndex: 'task_state',
|
dataIndex: 'task_state',
|
||||||
render: (value) => containerTaskStatus[value] || value,
|
valueMap: containerTaskStatus,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ export class Services extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Service State'),
|
title: t('Service State'),
|
||||||
dataIndex: 'state',
|
dataIndex: 'state',
|
||||||
render: (value) => serviceState[value] || value,
|
valueMap: serviceState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Last Updated'),
|
title: t('Last Updated'),
|
||||||
|
@ -43,12 +43,12 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('Status'),
|
label: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => InstanceStatus[value] || value,
|
valueMap: InstanceStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Locality'),
|
label: t('Locality'),
|
||||||
dataIndex: 'locality',
|
dataIndex: 'locality',
|
||||||
render: (value) => policyType[value] || value,
|
valueMap: policyType,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ export class InstancesDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => InstanceStatus[value] || value,
|
valueMap: InstanceStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Project ID'),
|
title: t('Project ID'),
|
||||||
|
@ -109,7 +109,7 @@ export class Instances extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => InstanceStatus[value] || value,
|
valueMap: InstanceStatus,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ export class Event extends Base {
|
|||||||
title: t('Resource Status'),
|
title: t('Resource Status'),
|
||||||
dataIndex: 'resource_status',
|
dataIndex: 'resource_status',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => stackStatus[value] || value,
|
valueMap: stackStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Resource Status Reason'),
|
title: t('Resource Status Reason'),
|
||||||
|
@ -193,7 +193,7 @@ export class Resource extends Base {
|
|||||||
title: t('Resource Status'),
|
title: t('Resource Status'),
|
||||||
dataIndex: 'resource_status',
|
dataIndex: 'resource_status',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => stackStatus[value] || value,
|
valueMap: stackStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Resource Status Reason'),
|
title: t('Resource Status Reason'),
|
||||||
|
@ -52,7 +52,7 @@ export class StackDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Stack Status'),
|
title: t('Stack Status'),
|
||||||
dataIndex: 'stack_status',
|
dataIndex: 'stack_status',
|
||||||
render: (value) => stackStatus[value] || value,
|
valueMap: stackStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Description'),
|
title: t('Description'),
|
||||||
|
@ -79,7 +79,7 @@ export class Stack extends Base {
|
|||||||
title: t('Stack Status'),
|
title: t('Stack Status'),
|
||||||
dataIndex: 'stack_status',
|
dataIndex: 'stack_status',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => stackStatus[value] || value,
|
valueMap: stackStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -88,7 +88,7 @@ export class Certificate extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Certificate Type'),
|
title: t('Certificate Type'),
|
||||||
dataIndex: 'mode',
|
dataIndex: 'mode',
|
||||||
render: (value) => certificateMode[value] || value,
|
valueMap: certificateMode,
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -130,7 +130,7 @@ export class Certificate extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => certificateStatus[value] || value,
|
valueMap: certificateStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -95,7 +95,7 @@ export class PortForwarding extends Base {
|
|||||||
title: t('Protocol'),
|
title: t('Protocol'),
|
||||||
dataIndex: 'protocol',
|
dataIndex: 'protocol',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => portForwardingProtocols[value] || value,
|
valueMap: portForwardingProtocols,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Description'),
|
title: t('Description'),
|
||||||
|
@ -50,7 +50,7 @@ export class FloatingIpDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (data) => floatingIpStatus[data] || '-',
|
valueMap: floatingIpStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Project ID'),
|
title: t('Project ID'),
|
||||||
|
@ -297,7 +297,7 @@ export class FloatingIps extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => floatingIpStatus[value] || value,
|
valueMap: floatingIpStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -75,7 +75,7 @@ export class Members extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'provisioning_status',
|
dataIndex: 'provisioning_status',
|
||||||
render: (data) => provisioningStatusCodes[data],
|
valueMap: provisioningStatusCodes,
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@ export class ListenerDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'provisioning_status',
|
dataIndex: 'provisioning_status',
|
||||||
render: (t) => provisioningStatusCodes[t],
|
valueMap: provisioningStatusCodes,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Max connect'),
|
title: t('Max connect'),
|
||||||
|
@ -74,7 +74,7 @@ export class Listeners extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'provisioning_status',
|
dataIndex: 'provisioning_status',
|
||||||
render: (t) => provisioningStatusCodes[t],
|
valueMap: provisioningStatusCodes,
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@ export class LoadBalancerDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'provisioning_status',
|
dataIndex: 'provisioning_status',
|
||||||
render: (data) => provisioningStatusCodes[data],
|
valueMap: provisioningStatusCodes,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Network'),
|
title: t('Network'),
|
||||||
|
@ -118,7 +118,7 @@ export class LoadBalancerInstance extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Operating Status'),
|
title: t('Operating Status'),
|
||||||
dataIndex: 'operating_status',
|
dataIndex: 'operating_status',
|
||||||
render: (t) => operatingStatusCodes[t],
|
valueMap: operatingStatusCodes,
|
||||||
titleTip: (
|
titleTip: (
|
||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
@ -135,7 +135,7 @@ export class LoadBalancerInstance extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Provisioning Status'),
|
title: t('Provisioning Status'),
|
||||||
dataIndex: 'provisioning_status',
|
dataIndex: 'provisioning_status',
|
||||||
render: (t) => provisioningStatusCodes[t],
|
valueMap: provisioningStatusCodes,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Listener Number'),
|
title: t('Listener Number'),
|
||||||
|
@ -76,7 +76,7 @@ export class NetworkDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (data) => networkStatus[data] || '-',
|
valueMap: networkStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Admin State'),
|
title: t('Admin State'),
|
||||||
|
@ -57,7 +57,7 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('VNIC Type'),
|
label: t('VNIC Type'),
|
||||||
dataIndex: 'binding:vnic_type',
|
dataIndex: 'binding:vnic_type',
|
||||||
render: (value) => bindingTypes[value] || value,
|
valueMap: bindingTypes,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if (this.qosEndpoint) {
|
if (this.qosEndpoint) {
|
||||||
|
@ -95,7 +95,7 @@ export class PortDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (data) => networkStatus[data] || '-',
|
valueMap: networkStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Owned Network'),
|
title: t('Owned Network'),
|
||||||
|
@ -250,7 +250,7 @@ export class Port extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => portStatus[value] || value,
|
valueMap: portStatus,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if (this.isInstanceDetail) {
|
if (this.isInstanceDetail) {
|
||||||
|
@ -49,7 +49,7 @@ export class RouterDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (data) => routerStatus[data] || '-',
|
valueMap: routerStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Admin State'),
|
title: t('Admin State'),
|
||||||
|
@ -146,7 +146,7 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('VNIC Type'),
|
label: t('VNIC Type'),
|
||||||
dataIndex: 'binding__vnic_type',
|
dataIndex: 'binding__vnic_type',
|
||||||
render: (value) => bindingTypes[value] || value,
|
valueMap: bindingTypes,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if (this.detailData.binding__host_id) {
|
if (this.detailData.binding__host_id) {
|
||||||
|
@ -45,7 +45,7 @@ export class PortDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (data) => portStatus[data] || '-',
|
valueMap: portStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Project ID'),
|
title: t('Project ID'),
|
||||||
|
@ -89,7 +89,7 @@ export class Ports extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => portStatus[value] || value,
|
valueMap: portStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -181,12 +181,12 @@ export class Create extends ModalAction {
|
|||||||
{
|
{
|
||||||
title: t('State'),
|
title: t('State'),
|
||||||
dataIndex: 'state',
|
dataIndex: 'state',
|
||||||
render: (value) => availabilityZoneState[value] || value,
|
valueMap: availabilityZoneState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Resource Type'),
|
title: t('Resource Type'),
|
||||||
dataIndex: 'resource',
|
dataIndex: 'resource',
|
||||||
render: (value) => availabilityZoneResource[value] || value,
|
valueMap: availabilityZoneResource,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -218,7 +218,7 @@ export class Create extends ModalAction {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => networkStatus[value] || value,
|
valueMap: networkStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -73,7 +73,7 @@ export class SetGateway extends ModalAction {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => networkStatus[value] || value,
|
valueMap: networkStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -87,7 +87,7 @@ export class IPsecSiteConnection extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (v) => vpnStatus[v],
|
valueMap: vpnStatus,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ export class VPNGateway extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (v) => vpnStatus[v],
|
valueMap: vpnStatus,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -59,12 +59,12 @@ export class ShareAccessRule extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Access Level'),
|
title: t('Access Level'),
|
||||||
dataIndex: 'access_level',
|
dataIndex: 'access_level',
|
||||||
render: (value) => shareAccessLevel[value] || value,
|
valueMap: shareAccessLevel,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('State'),
|
title: t('State'),
|
||||||
dataIndex: 'state',
|
dataIndex: 'state',
|
||||||
render: (value) => shareAccessRuleState[value] || value,
|
valueMap: shareAccessRuleState,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Access Key'),
|
title: t('Access Key'),
|
||||||
|
@ -57,7 +57,7 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('Protocol'),
|
label: t('Protocol'),
|
||||||
dataIndex: 'share_proto',
|
dataIndex: 'share_proto',
|
||||||
render: (value) => shareProtocol[value] || value,
|
valueMap: shareProtocol,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Public'),
|
label: t('Public'),
|
||||||
|
@ -53,7 +53,7 @@ export class Detail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => shareStatus[value] || value,
|
valueMap: shareStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -123,7 +123,7 @@ export class Share extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Protocol'),
|
title: t('Protocol'),
|
||||||
dataIndex: 'share_proto',
|
dataIndex: 'share_proto',
|
||||||
render: (value) => shareProtocol[value] || value,
|
valueMap: shareProtocol,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Public'),
|
title: t('Public'),
|
||||||
@ -135,7 +135,7 @@ export class Share extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => shareStatus[value] || value,
|
valueMap: shareStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Share Network'),
|
title: t('Share Network'),
|
||||||
|
@ -52,7 +52,7 @@ export class Detail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => shareGroupStatus[value] || value,
|
valueMap: shareGroupStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -52,7 +52,7 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('Access Rules Status'),
|
label: t('Access Rules Status'),
|
||||||
dataIndex: 'access_rules_status',
|
dataIndex: 'access_rules_status',
|
||||||
render: (value) => accessRuleStatus[value] || value,
|
valueMap: accessRuleStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Progress'),
|
label: t('Progress'),
|
||||||
|
@ -45,7 +45,7 @@ export class Detail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => shareStatus[value] || value,
|
valueMap: shareStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created'),
|
title: t('Created'),
|
||||||
|
@ -55,7 +55,7 @@ export class ShareInstance extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => shareStatus[value] || value,
|
valueMap: shareStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Availability Zone'),
|
title: t('Availability Zone'),
|
||||||
|
@ -46,7 +46,7 @@ export class Detail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => shareServerStatus[value] || value,
|
valueMap: shareServerStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created'),
|
title: t('Created'),
|
||||||
|
@ -56,7 +56,7 @@ export class ShareServer extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => shareServerStatus[value] || value,
|
valueMap: shareServerStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Share Network'),
|
title: t('Share Network'),
|
||||||
|
@ -66,7 +66,7 @@ export class Detail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => backupStatus[value] || value,
|
valueMap: backupStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Project ID'),
|
title: t('Project ID'),
|
||||||
|
@ -105,7 +105,7 @@ export class Backup extends Base {
|
|||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => backupStatus[value] || value,
|
valueMap: backupStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -52,7 +52,7 @@ export class Detail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (data) => volumeStatus[data] || '-',
|
valueMap: volumeStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Size'),
|
title: t('Size'),
|
||||||
|
@ -112,7 +112,7 @@ export class Snapshots extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => volumeStatus[value] || value,
|
valueMap: volumeStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Volume ID/Name'),
|
title: t('Volume ID/Name'),
|
||||||
|
@ -63,7 +63,7 @@ export class VolumeDetail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => volumeStatus[value] || value,
|
valueMap: volumeStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Size'),
|
title: t('Size'),
|
||||||
|
@ -468,7 +468,7 @@ export class Create extends FormAction {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => volumeStatus[value] || value,
|
valueMap: volumeStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Description'),
|
title: t('Description'),
|
||||||
|
@ -84,7 +84,7 @@ export class RestoreAction extends ModalAction {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => volumeStatus[value] || value,
|
valueMap: volumeStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -49,7 +49,7 @@ export class Detail extends Base {
|
|||||||
{
|
{
|
||||||
title: t('Consumer'),
|
title: t('Consumer'),
|
||||||
dataIndex: 'consumer',
|
dataIndex: 'consumer',
|
||||||
render: (value) => consumerTypes[value] || value,
|
valueMap: consumerTypes,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ export class QosSpecs extends Base {
|
|||||||
title: t('Consumer'),
|
title: t('Consumer'),
|
||||||
dataIndex: 'consumer',
|
dataIndex: 'consumer',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => consumerTypes[value] || value,
|
valueMap: consumerTypes,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Specs'),
|
title: t('Specs'),
|
||||||
|
@ -30,7 +30,7 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('Control Location'),
|
label: t('Control Location'),
|
||||||
dataIndex: 'encryption.control_location',
|
dataIndex: 'encryption.control_location',
|
||||||
render: (value) => controls[value] || value,
|
valueMap: controls,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Cipher'),
|
label: t('Cipher'),
|
||||||
|
@ -93,7 +93,7 @@ export class ManageQos extends ModalAction {
|
|||||||
{
|
{
|
||||||
title: t('Consumer'),
|
title: t('Consumer'),
|
||||||
dataIndex: 'consumer',
|
dataIndex: 'consumer',
|
||||||
render: (value) => consumerTypes[value] || value,
|
valueMap: consumerTypes,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Specs'),
|
title: t('Specs'),
|
||||||
|
@ -74,7 +74,7 @@ export const backupPointColumns = [
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => backupStatus[value] || value,
|
valueMap: backupStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Backup Mode'),
|
title: t('Backup Mode'),
|
||||||
|
@ -167,7 +167,7 @@ export const volumeColumns = [
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => volumeStatus[value] || value,
|
valueMap: volumeStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Shared'),
|
title: t('Shared'),
|
||||||
@ -277,7 +277,7 @@ export const getVolumeColumnsList = (self) => {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => volumeStatus[value] || value,
|
valueMap: volumeStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Type'),
|
title: t('Type'),
|
||||||
@ -290,7 +290,7 @@ export const getVolumeColumnsList = (self) => {
|
|||||||
title: t('Disk Tag'),
|
title: t('Disk Tag'),
|
||||||
dataIndex: 'disk_tag',
|
dataIndex: 'disk_tag',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => diskTag[value] || value,
|
valueMap: diskTag,
|
||||||
sorter: false,
|
sorter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -333,7 +333,7 @@ export const getVolumeColumnsList = (self) => {
|
|||||||
),
|
),
|
||||||
dataIndex: 'bootable',
|
dataIndex: 'bootable',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => bootableType[value] || value,
|
valueMap: bootableType,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Shared'),
|
title: t('Shared'),
|
||||||
|
@ -189,7 +189,7 @@ export const getImageColumns = (self) => [
|
|||||||
{
|
{
|
||||||
title: t('System'),
|
title: t('System'),
|
||||||
dataIndex: 'os_distro',
|
dataIndex: 'os_distro',
|
||||||
render: (value) => imageOS[value] || value,
|
valueMap: imageOS,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('OS Version'),
|
title: t('OS Version'),
|
||||||
@ -208,12 +208,12 @@ export const getImageColumns = (self) => [
|
|||||||
{
|
{
|
||||||
title: t('Access Control'),
|
title: t('Access Control'),
|
||||||
dataIndex: 'visibility',
|
dataIndex: 'visibility',
|
||||||
render: (value) => imageVisibility[value] || value,
|
valueMap: imageVisibility,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Format'),
|
title: t('Format'),
|
||||||
dataIndex: 'disk_format',
|
dataIndex: 'disk_format',
|
||||||
render: (value) => imageFormats[value] || value,
|
valueMap: imageFormats,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Image Size'),
|
title: t('Image Size'),
|
||||||
|
@ -37,12 +37,12 @@ export const getBaseSnapshotColumns = (self) => [
|
|||||||
title: t('Disk Format'),
|
title: t('Disk Format'),
|
||||||
dataIndex: 'disk_format',
|
dataIndex: 'disk_format',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => imageFormats[value] || value,
|
valueMap: imageFormats,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => imageStatus[value] || value,
|
valueMap: imageStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -46,7 +46,7 @@ export const getShareGroupColumns = (self) => {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => shareGroupStatus[value] || value,
|
valueMap: shareGroupStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -55,7 +55,7 @@ export const networkColumns = (self) => [
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => networkStatus[value] || value,
|
valueMap: networkStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Subnet Count'),
|
title: t('Subnet Count'),
|
||||||
|
@ -152,7 +152,7 @@ export function getPortFormItem(withResourceNameAndStatusFilter = true) {
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => portStatus[value] || value,
|
valueMap: portStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Bind Resource'),
|
title: t('Bind Resource'),
|
||||||
@ -268,7 +268,7 @@ export const portColumns = [
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => portStatus[value] || value,
|
valueMap: portStatus,
|
||||||
sorter: false,
|
sorter: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -48,7 +48,7 @@ export const getRouterColumns = (self) => [
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => routerStatus[value] || value,
|
valueMap: routerStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Open External Gateway'),
|
title: t('Open External Gateway'),
|
||||||
|
@ -146,7 +146,7 @@ export const getBaseColumns = (self) => [
|
|||||||
{
|
{
|
||||||
title: t('Category'),
|
title: t('Category'),
|
||||||
dataIndex: 'category',
|
dataIndex: 'category',
|
||||||
render: (value) => flavorCategoryList[value] || value,
|
valueMap: flavorCategoryList,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('CPU'),
|
title: t('CPU'),
|
||||||
@ -224,19 +224,19 @@ export const gpuColumns = [
|
|||||||
title: t('CPU Policy'),
|
title: t('CPU Policy'),
|
||||||
dataIndex: 'hw:cpu_policy',
|
dataIndex: 'hw:cpu_policy',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => cpuPolicyList[value] || value,
|
valueMap: cpuPolicyList,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('CPU Thread Policy'),
|
title: t('CPU Thread Policy'),
|
||||||
dataIndex: 'hw:cpu_thread_policy',
|
dataIndex: 'hw:cpu_thread_policy',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => cpuThreadPolicyMap[value] || value,
|
valueMap: cpuThreadPolicyMap,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Memory Page'),
|
title: t('Memory Page'),
|
||||||
dataIndex: 'hw:mem_page_size',
|
dataIndex: 'hw:mem_page_size',
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
render: (value) => pageTypeMap[value] || value,
|
valueMap: pageTypeMap,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -510,7 +510,7 @@ export const actionColumn = (self) => {
|
|||||||
{
|
{
|
||||||
title: t('Operation Name'),
|
title: t('Operation Name'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
render: (value) => actionMap[value],
|
valueMap: actionMap,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Project ID/Name'),
|
title: t('Project ID/Name'),
|
||||||
|
@ -50,7 +50,7 @@ export const getCertificateColumns = (self) => [
|
|||||||
{
|
{
|
||||||
title: t('Certificate Type'),
|
title: t('Certificate Type'),
|
||||||
dataIndex: 'mode',
|
dataIndex: 'mode',
|
||||||
render: (value) => certificateMode[value] || value,
|
valueMap: certificateMode,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Expires At'),
|
title: t('Expires At'),
|
||||||
@ -86,7 +86,7 @@ export const getCertificateColumns = (self) => [
|
|||||||
{
|
{
|
||||||
title: t('Status'),
|
title: t('Status'),
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
render: (value) => certificateStatus[value] || value,
|
valueMap: certificateStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Created At'),
|
title: t('Created At'),
|
||||||
|
@ -48,7 +48,7 @@ export const actionColumn = (self) => {
|
|||||||
{
|
{
|
||||||
title: t('Operation Name'),
|
title: t('Operation Name'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
render: (value) => actionMap[value] || value,
|
valueMap: actionMap,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('Project ID/Name'),
|
title: t('Project ID/Name'),
|
||||||
|
@ -14,7 +14,15 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { isArray, get, isString, isBoolean, isNil, isObjectLike } from 'lodash';
|
import {
|
||||||
|
isArray,
|
||||||
|
get,
|
||||||
|
isString,
|
||||||
|
isBoolean,
|
||||||
|
isNil,
|
||||||
|
isObjectLike,
|
||||||
|
isObject,
|
||||||
|
} from 'lodash';
|
||||||
import Status from 'components/Status';
|
import Status from 'components/Status';
|
||||||
import { renderFilterMap } from 'utils/index';
|
import { renderFilterMap } from 'utils/index';
|
||||||
import { getLinkRender } from 'utils/route-map';
|
import { getLinkRender } from 'utils/route-map';
|
||||||
@ -235,3 +243,14 @@ export const idNameColumn = {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getValueMapRender = (column) => {
|
||||||
|
const { valueMap, render } = column;
|
||||||
|
if (render) {
|
||||||
|
return render;
|
||||||
|
}
|
||||||
|
if (valueMap && isObject(valueMap)) {
|
||||||
|
return (value) => valueMap[value] || value;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user