fix: add i18n and fix datastore of trove

1. The trove creates an instance affinity and anti-affinity label that requires i18n
2. Add i18n for trove instance status
3. The value of the database version of the configuration group is incorrectly set
4. Add allowClear true for select component

Change-Id: Ic6058530b57b1f8f7face48061c5a3b018459a5a
This commit is contained in:
xusongfu 2022-05-06 10:25:30 +08:00
parent 17bd59ec15
commit f48011a983
11 changed files with 22 additions and 12 deletions

View File

@ -61,11 +61,17 @@ export default class index extends Component {
isWrappedValue,
checkOptions,
checkBoxInfo,
allowClear = true,
...rest
} = this.props;
if (isUndefined(value) || isNull(value)) {
return (
<Select {...rest} placeholder={placeholder} onChange={this.onChange} />
<Select
{...rest}
allowClear={allowClear}
placeholder={placeholder}
onChange={this.onChange}
/>
);
}
if (checkOptions) {
@ -81,6 +87,7 @@ export default class index extends Component {
<Col span={12}>
<Select
{...rest}
allowClear={allowClear}
placeholder={placeholder}
onChange={this.onChange}
value={this.getValue()}
@ -96,6 +103,7 @@ export default class index extends Component {
return (
<Select
{...rest}
allowClear={allowClear}
placeholder={placeholder}
onChange={this.onChange}
value={this.getValue()}

View File

@ -1954,7 +1954,6 @@
"Target Storage Backend": "Target Storage Backend",
"Template Content": "Template Content",
"Template Name": "Template Name",
"Tenant Id": "Tenant Id",
"Thailand": "Thailand",
"That is, after how many consecutive failures of the health check, the health check status of the back-end cloud server is changed from normal to abnormal": "That is, after how many consecutive failures of the health check, the health check status of the back-end cloud server is changed from normal to abnormal",
"The Federation of Saint Kitts and Nevis": "The Federation of Saint Kitts and Nevis",

View File

@ -1954,7 +1954,6 @@
"Target Storage Backend": "目标存储后端",
"Template Content": "模板内容",
"Template Name": "模板名称",
"Tenant Id": "项目ID",
"Thailand": "泰国",
"That is, after how many consecutive failures of the health check, the health check status of the back-end cloud server is changed from normal to abnormal": "即健康检查连续失败多少次后,将后端云服务器的健康检查状态由正常改为不正常",
"The Federation of Saint Kitts and Nevis": "圣基茨和尼维斯",

View File

@ -68,7 +68,7 @@ export class Create extends ModalAction {
get datastoresVersion() {
const dizi = this.datastores
.filter((item) => item.label === this.state.datastoreType)
.filter((item) => item.label === this.state.datastore_type)
.map((it) => {
return it.originData.versions.map((e) => ({
label: e.name,

View File

@ -14,6 +14,7 @@
import { inject, observer } from 'mobx-react';
import Base from 'containers/BaseDetail';
import { InstanceStatus, policyType } from 'resources/database';
export class BaseDetail extends Base {
get leftCards() {
@ -41,10 +42,12 @@ export class BaseDetail extends Base {
{
label: t('Status'),
dataIndex: 'status',
render: (value) => InstanceStatus[value] || value,
},
{
label: t('Locality'),
dataIndex: 'locality',
render: (value) => policyType[value] || value,
},
];

View File

@ -15,6 +15,7 @@
import { inject, observer } from 'mobx-react';
import Base from 'containers/TabDetail';
import globalInstancesStore from 'stores/trove/instances';
import { InstanceStatus } from 'resources/database';
import BaseDetail from './BaseDetail';
import Users from './Users';
import Databases from './Databases';
@ -52,10 +53,12 @@ export class InstancesDetail extends Base {
{
title: t('Status'),
dataIndex: 'status',
render: (value) => InstanceStatus[value] || value,
},
{
title: t('Tenant Id'),
title: t('Project ID'),
dataIndex: 'tenant_id',
hidden: !this.isAdminPage,
},
];
}

View File

@ -209,11 +209,11 @@ export class StepDetails extends Base {
type: 'select',
options: [
{
label: 'Affinity',
label: t('Affinity'),
value: 'affinity',
},
{
label: 'Anti-affinity',
label: t('Anti-Affinity'),
value: 'anti-affinity',
},
],

View File

@ -76,7 +76,7 @@ export class Instances extends Base {
{
title: t('Status'),
dataIndex: 'status',
render: (value) => InstanceStatus[value],
render: (value) => InstanceStatus[value] || value,
},
];
}

View File

@ -427,7 +427,6 @@ export class CreateNetwork extends ModalAction {
tip: subnetIpv6Tip,
hidden: ip_version !== 'ipv6',
dependencies: ['ipv6_address_mode'],
allowClear: true,
validator: (rule, value) => {
const ipv6_address_mode =
(this.formRef.current &&
@ -463,7 +462,6 @@ export class CreateNetwork extends ModalAction {
],
tip: subnetIpv6Tip,
hidden: ip_version !== 'ipv6',
allowClear: true,
},
{
name: 'cidr',

View File

@ -201,7 +201,6 @@ export default class CreateSubnet extends ModalAction {
tip: subnetIpv6Tip,
hidden: ip_version !== 'ipv6',
dependencies: ['ipv6_address_mode'],
allowClear: true,
validator: (rule, value) => {
const ipv6_address_mode =
(this.formRef.current &&
@ -237,7 +236,6 @@ export default class CreateSubnet extends ModalAction {
],
tip: subnetIpv6Tip,
hidden: ip_version !== 'ipv6',
allowClear: true,
},
{
name: 'cidr',

View File

@ -26,3 +26,5 @@ export const InstanceStatus = {
PROMOTE: t('Promote'),
EJECT: t('Eject'),
};
export { default as policyType } from './server-group';