fix: Fix the search filters
1. Add search filters of baremetal node list 2. Use public function getOptions to format some select options Change-Id: I2952878ab21656364031db0216a32879ce87862c
This commit is contained in:
parent
4f7dec52bd
commit
438772f6f3
@ -17,6 +17,7 @@ import Base from 'containers/List';
|
||||
import globalIronicStore from 'stores/ironic/ironic';
|
||||
import { powerState, provisioningState } from 'resources/ironic';
|
||||
import { ironicOriginEndpoint } from 'client/client/constants';
|
||||
import { getOptions } from 'utils';
|
||||
import actionConfigs from './actions';
|
||||
|
||||
@inject('rootStore')
|
||||
@ -99,7 +100,22 @@ export default class BareMetalNode extends Base {
|
||||
];
|
||||
|
||||
get searchFilters() {
|
||||
return [];
|
||||
return [
|
||||
{
|
||||
label: t('Name'),
|
||||
name: 'name',
|
||||
},
|
||||
{
|
||||
label: t('Power State'),
|
||||
name: 'power_state',
|
||||
options: getOptions(powerState),
|
||||
},
|
||||
{
|
||||
label: t('Provision State'),
|
||||
name: 'provision_state',
|
||||
options: getOptions(provisioningState),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
updateFetchParams = (params) => {
|
||||
|
@ -17,6 +17,7 @@ import Base from 'containers/List';
|
||||
import { serviceStatus, serviceState } from 'resources/service';
|
||||
import globalComputeHostStore from 'stores/nova/compute-host';
|
||||
import { onlyAdminCanReadPolicy } from 'resources/policy';
|
||||
import { getOptions } from 'utils';
|
||||
import actionConfigs from './actions';
|
||||
|
||||
@inject('rootStore')
|
||||
@ -94,18 +95,12 @@ export default class ComputeHost extends Base {
|
||||
{
|
||||
label: t('Service Status'),
|
||||
name: 'status',
|
||||
options: Object.keys(serviceStatus).map((key) => ({
|
||||
key,
|
||||
label: serviceStatus[key],
|
||||
})),
|
||||
options: getOptions(serviceStatus),
|
||||
},
|
||||
{
|
||||
label: t('Service State'),
|
||||
name: 'state',
|
||||
options: Object.keys(serviceState).map((key) => ({
|
||||
key,
|
||||
label: serviceState[key],
|
||||
})),
|
||||
options: getOptions(serviceState),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -189,10 +189,7 @@ export class Image extends Base {
|
||||
{
|
||||
label: t('Status'),
|
||||
name: 'status',
|
||||
options: Object.keys(imageStatus).map((key) => ({
|
||||
key,
|
||||
label: imageStatus[key],
|
||||
})),
|
||||
options: getOptions(imageStatus),
|
||||
},
|
||||
];
|
||||
const values = ['public', 'shared'];
|
||||
|
@ -22,6 +22,7 @@ import Base from 'components/Form';
|
||||
import { getPasswordOtherRule, asciiValidator } from 'utils/validate';
|
||||
import { hypervisorColumns, hypervisorFilters } from 'resources/hypervisor';
|
||||
import { physicalNodeTypes } from 'resources/instance';
|
||||
import { getOptions } from 'utils';
|
||||
|
||||
export class SystemStep extends Base {
|
||||
init() {
|
||||
@ -319,10 +320,7 @@ export class SystemStep extends Base {
|
||||
{
|
||||
label: t('Policy'),
|
||||
name: 'policy',
|
||||
options: Object.keys(policyType).map((key) => ({
|
||||
key,
|
||||
label: policyType[key],
|
||||
})),
|
||||
options: getOptions(policyType),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -16,6 +16,7 @@ import { observer, inject } from 'mobx-react';
|
||||
import Base from 'containers/List';
|
||||
import globalServerGroupStore from 'stores/nova/server-group';
|
||||
import policyType from 'resources/server-group';
|
||||
import { getOptions } from 'utils';
|
||||
import actionConfigs from './actions';
|
||||
|
||||
@inject('rootStore')
|
||||
@ -80,10 +81,7 @@ export default class ServerGroup extends Base {
|
||||
{
|
||||
label: t('Policy'),
|
||||
name: 'policy',
|
||||
options: Object.keys(policyType).map((key) => ({
|
||||
key,
|
||||
label: policyType[key],
|
||||
})),
|
||||
options: getOptions(policyType),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import { observer, inject } from 'mobx-react';
|
||||
import Base from 'containers/List';
|
||||
import { serviceStatus, serviceState } from 'resources/service';
|
||||
import globalServiceStore from 'stores/cinder/service';
|
||||
import { getOptions } from 'utils';
|
||||
import actionConfigs from './actions';
|
||||
|
||||
@inject('rootStore')
|
||||
@ -93,18 +94,12 @@ export default class CinderService extends Base {
|
||||
{
|
||||
label: t('Service Status'),
|
||||
name: 'status',
|
||||
options: Object.keys(serviceStatus).map((key) => ({
|
||||
label: serviceStatus[key],
|
||||
key,
|
||||
})),
|
||||
options: getOptions(serviceStatus),
|
||||
},
|
||||
{
|
||||
label: t('Service State'),
|
||||
name: 'state',
|
||||
options: Object.keys(serviceState).map((key) => ({
|
||||
label: serviceState[key],
|
||||
key,
|
||||
})),
|
||||
options: getOptions(serviceState),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import { observer, inject } from 'mobx-react';
|
||||
import Base from 'containers/List';
|
||||
import { serviceStatus, serviceState } from 'resources/service';
|
||||
import { ComputeHostStore } from 'stores/nova/compute-host';
|
||||
import { getOptions } from 'utils';
|
||||
import actionConfigs from './actions';
|
||||
|
||||
@inject('rootStore')
|
||||
@ -94,18 +95,12 @@ export default class ComputeService extends Base {
|
||||
{
|
||||
label: t('Service Status'),
|
||||
name: 'status',
|
||||
options: Object.keys(serviceStatus).map((key) => ({
|
||||
label: serviceStatus[key],
|
||||
key,
|
||||
})),
|
||||
options: getOptions(serviceStatus),
|
||||
},
|
||||
{
|
||||
label: t('Service State'),
|
||||
name: 'state',
|
||||
options: Object.keys(serviceState).map((key) => ({
|
||||
label: serviceState[key],
|
||||
key,
|
||||
})),
|
||||
options: getOptions(serviceState),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import Base from 'containers/List';
|
||||
import { serviceState } from 'resources/service';
|
||||
|
||||
import { getOptions } from 'utils';
|
||||
import globalHeatServiceStore from 'stores/heat/service';
|
||||
|
||||
@inject('rootStore')
|
||||
@ -74,10 +74,7 @@ export default class HeatService extends Base {
|
||||
{
|
||||
label: t('Status'),
|
||||
name: 'status',
|
||||
options: Object.keys(serviceState).map((key) => ({
|
||||
label: serviceState[key],
|
||||
key,
|
||||
})),
|
||||
options: getOptions(serviceState),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import { Col, Popover, Row } from 'antd';
|
||||
import { FileTextOutlined } from '@ant-design/icons';
|
||||
import { qosEndpoint } from 'client/client/constants';
|
||||
import { enablePFW } from 'resources/neutron';
|
||||
import { getOptions } from 'utils';
|
||||
import styles from './styles.less';
|
||||
import actionConfigs from './actions';
|
||||
|
||||
@ -222,10 +223,7 @@ export class FloatingIps extends Base {
|
||||
{
|
||||
label: t('Status'),
|
||||
name: 'status',
|
||||
options: Object.keys(floatingIpStatus).map((key) => ({
|
||||
label: floatingIpStatus[key],
|
||||
key,
|
||||
})),
|
||||
options: getOptions(floatingIpStatus),
|
||||
},
|
||||
];
|
||||
return filters;
|
||||
|
@ -17,6 +17,7 @@ import { observer, inject } from 'mobx-react';
|
||||
import Base from 'containers/List';
|
||||
import { portStatus } from 'resources/port';
|
||||
import { PortStore } from 'stores/neutron/port';
|
||||
import { getOptions } from 'utils';
|
||||
|
||||
@inject('rootStore')
|
||||
@observer
|
||||
@ -109,10 +110,7 @@ export default class Ports extends Base {
|
||||
{
|
||||
label: t('Status'),
|
||||
name: 'status',
|
||||
options: Object.keys(portStatus).map((key) => ({
|
||||
label: portStatus[key],
|
||||
key,
|
||||
})),
|
||||
options: getOptions(portStatus),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
import React from 'react';
|
||||
import globalRouterStore from 'stores/neutron/router';
|
||||
import { getPortsWithFixedIPs, getSubnetToRouter } from 'resources/floatingip';
|
||||
import { getOptions } from 'utils';
|
||||
|
||||
export const routerStatus = {
|
||||
ACTIVE: t('Active'),
|
||||
@ -87,10 +88,7 @@ export const routerFilters = [
|
||||
{
|
||||
label: t('Status'),
|
||||
name: 'status',
|
||||
options: Object.keys(routerStatus).map((key) => ({
|
||||
label: routerStatus[key],
|
||||
key,
|
||||
})),
|
||||
options: getOptions(routerStatus),
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
import React from 'react';
|
||||
import { isNumber } from 'lodash';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { getOptions } from 'utils';
|
||||
|
||||
export const ipProtocols = [
|
||||
{ value: 'ah', label: t('AH') },
|
||||
@ -114,10 +115,7 @@ export const filterParams = [
|
||||
{
|
||||
label: t('Direction'),
|
||||
name: 'direction',
|
||||
options: Object.keys(directions).map((key) => ({
|
||||
label: directions[key],
|
||||
key,
|
||||
})),
|
||||
options: getOptions(directions),
|
||||
},
|
||||
{
|
||||
label: t('Ether Type'),
|
||||
|
Loading…
Reference in New Issue
Block a user