fix: HistoryRollback internationalization

This commit is contained in:
王彦民 2018-12-01 23:25:03 +08:00 committed by zhichen
parent 4f419b0058
commit d487f522b6
3 changed files with 52 additions and 35 deletions

View File

@ -143,5 +143,20 @@ const I18N_CONF = {
queryResultsQuery: 'Search Results: Found',
articleMeetRequirementsConfiguration: 'configuration items.',
},
HistoryRollback: {
details: 'Details',
rollback: 'Roll Back',
pubNoData: 'No results found.',
toConfigure: 'Historical Versions (Configuration record is retained for 30 days.)',
dataId: 'Enter Data ID',
dataIdCanNotBeEmpty: 'Data ID cannot be empty',
group: 'Enter Group',
groupCanNotBeEmpty: 'Group cannot be empty',
query: 'Search',
queryResult: 'Search Results: Found',
articleMeet: 'configuration items.',
lastUpdateTime: 'Last Modified At',
operation: 'Operation',
},
};
export default I18N_CONF;

View File

@ -143,5 +143,20 @@ const I18N_CONF = {
queryResultsQuery: '查询结果:共查询到',
articleMeetRequirementsConfiguration: '条满足要求的配置。',
},
HistoryRollback: {
details: '详情',
rollback: '回滚',
pubNoData: '没有数据',
toConfigure: '历史版本(保留30天)',
dataId: '请输入Data ID',
dataIdCanNotBeEmpty: 'Data ID不能为空',
group: '请输入Group',
groupCanNotBeEmpty: 'Group不能为空',
query: '查询',
queryResult: '查询结果:共查询到',
articleMeet: '条满足要求的配置。',
lastUpdateTime: '最后更新时间',
operation: '操作',
},
};
export default I18N_CONF;

View File

@ -12,12 +12,16 @@
*/
import React from 'react';
import { Field, Form, Input, Loading, Pagination, Table } from '@alifd/next';
import RegionGroup from '../../../components/RegionGroup';
import { getParams, setParams, request, aliwareIntl } from '../../../globalLib';
import { ConfigProvider, Field, Form, Input, Loading, Pagination, Table } from '@alifd/next';
import RegionGroup from 'components/RegionGroup';
import { getParams, setParams, request, aliwareIntl } from '@/globalLib';
import './index.scss';
@ConfigProvider.config
class HistoryRollback extends React.Component {
static displayName = 'HistoryRollback';
constructor(props) {
super(props);
@ -144,14 +148,15 @@ class HistoryRollback extends React.Component {
showMore() {}
renderCol(value, index, record) {
const { locale = {} } = this.props;
return (
<div>
<a onClick={this.goDetail.bind(this, record)} style={{ marginRight: 5 }}>
{aliwareIntl.get('com.alibaba.nacos.page.historyRollback.details')}
{locale.details}
</a>
<span style={{ marginRight: 5 }}>|</span>
<a style={{ marginRight: 5 }} onClick={this.goRollBack.bind(this, record)}>
{aliwareIntl.get('com.alibaba.nacos.page.historyRollback.rollback')}
{locale.rollback}
</a>
</div>
);
@ -279,15 +284,9 @@ class HistoryRollback extends React.Component {
}
render() {
const pubnodedata = aliwareIntl.get('pubnodata');
const locale = {
empty: pubnodedata,
};
const { locale = {} } = this.props;
const { init } = this.field;
this.init = init;
return (
<div style={{ padding: 10 }}>
<Loading
@ -298,7 +297,7 @@ class HistoryRollback extends React.Component {
color="#333"
>
<RegionGroup
left={aliwareIntl.get('com.alibaba.nacos.page.historyRollback.to_configure')}
left={locale.toConfigure}
namespaceCallBack={this.cleanAndGetData.bind(this)}
/>
{/** <div className={'namespacewrapper'}>
@ -309,15 +308,13 @@ class HistoryRollback extends React.Component {
<Form inline field={this.field}>
<Form.Item label="Data ID:" required>
<Input
placeholder={aliwareIntl.get('com.alibaba.nacos.page.historyRollback.dataid')}
placeholder={locale.dataId}
style={{ width: 200 }}
{...this.init('dataId', {
rules: [
{
required: true,
message: aliwareIntl.get(
'com.alibaba.nacos.page.form.Data_Id_can_not_be_empty'
),
message: locale.dataIdCanNotBeEmpty,
},
],
})}
@ -325,15 +322,13 @@ class HistoryRollback extends React.Component {
</Form.Item>
<Form.Item label="Group:" required>
<Input
placeholder={aliwareIntl.get('com.alibaba.nacos.page.historyRollback.group')}
placeholder={locale.group}
style={{ width: 200 }}
{...this.init('group', {
rules: [
{
required: true,
message: aliwareIntl.get(
'com.alibaba.nacos.page.listeningToQuery.group_can_not_be_empty'
),
message: locale.groupCanNotBeEmpty,
},
],
})}
@ -347,7 +342,7 @@ class HistoryRollback extends React.Component {
onClick={this.selectAll.bind(this)}
style={{ marginRight: 10 }}
>
{aliwareIntl.get('com.alibaba.nacos.page.historyrollback.query')}
{locale.query}
</Form.Submit>
</Form.Item>
</Form>
@ -365,34 +360,26 @@ class HistoryRollback extends React.Component {
fontSize: 16,
}}
>
{aliwareIntl.get('com.alibaba.nacos.page.historyRollback.queryresult')}
{locale.queryResult}
<strong style={{ fontWeight: 'bold' }}> {this.state.total} </strong>
{aliwareIntl.get('com.alibaba.nacos.page.historyRollback.article_meet')}
{locale.articleMeet}
</h3>
</div>
<div>
<Table
dataSource={this.state.dataSource}
locale={locale}
language={aliwareIntl.currentLanguageCode}
>
<Table dataSource={this.state.dataSource} locale={{ empty: locale.pubNoData }}>
<Table.Column title="Data ID" dataIndex="dataId" />
<Table.Column title="Group" dataIndex="group" />
<Table.Column
title={aliwareIntl.get('com.alibaba.nacos.page.historyRollback.last_update_time')}
title={locale.lastUpdateTime}
dataIndex="time"
cell={this.renderLastTime.bind(this)}
/>
<Table.Column
title={aliwareIntl.get('com.alibaba.nacos.page.historyRollback.operation')}
cell={this.renderCol.bind(this)}
/>
<Table.Column title={locale.operation} cell={this.renderCol.bind(this)} />
</Table>
</div>
<div style={{ marginTop: 10, textAlign: 'right' }}>
<Pagination
current={this.state.currentPage}
language={aliwareIntl.currentLanguageCode}
total={this.state.total}
pageSize={this.state.pageSize}
onChange={this.changePage.bind(this)}