|
|
@@ -1,4 +1,5 @@
|
|
|
import React, {Component} from 'react';
|
|
|
+import {FormattedMessage} from 'react-intl';
|
|
|
import {Input, Radio, Collapse, Button, Icon, Tooltip} from 'antd';
|
|
|
import {ADD_DEPLOY, UPDATE_DEPLOY} from "../../../../gql";
|
|
|
import {request} from 'graphql-request'
|
|
|
@@ -12,7 +13,7 @@ const Panel = Collapse.Panel;
|
|
|
// 如需添加中文,请在此处 value 处添加
|
|
|
// eg: 'xxxx': <F.. id='xxx'/>
|
|
|
const valueToKey = {
|
|
|
- 'functionName': 'Name',
|
|
|
+ 'functionName': 'functionName',
|
|
|
'cosBucketName': 'cosBucketName',
|
|
|
'cosObjectName': 'cosObjectName',
|
|
|
'cosBucketRegion': 'cosBucketRegion',
|
|
|
@@ -219,7 +220,7 @@ class DeployCard extends Component {
|
|
|
return (
|
|
|
<div>
|
|
|
<div style={{marginBottom: 10}}>
|
|
|
- <span className='vice-title'>{valueToKey['functionName']}
|
|
|
+ <span className='vice-title'><FormattedMessage id={valueToKey['functionName']}/>
|
|
|
|
|
|
<Tooltip placement="top" title={toolTipTitle['functionName']}>
|
|
|
<Icon type="question-circle"/>
|
|
|
@@ -229,7 +230,7 @@ class DeployCard extends Component {
|
|
|
onChange={this.switchConfig('functionName')}/>
|
|
|
</div>
|
|
|
<div style={{marginBottom: 10}}>
|
|
|
- <span className='vice-title'>{valueToKey['region']}
|
|
|
+ <span className='vice-title'><FormattedMessage id={valueToKey['region']}/>
|
|
|
|
|
|
<Tooltip placement="top" title={toolTipTitle['region']}>
|
|
|
<Icon type="question-circle"/>
|
|
|
@@ -239,16 +240,16 @@ class DeployCard extends Component {
|
|
|
this.props.switchRegion(e);
|
|
|
}} defaultValue={this.state.region} value={removePrefix('ap-', this.state.region)}
|
|
|
buttonStyle="solid">
|
|
|
- <Radio.Button value="guangzhou">Guangzhou</Radio.Button>
|
|
|
- <Radio.Button value="shanghai">Shanghai</Radio.Button>
|
|
|
- <Radio.Button value="beijing">Beijing</Radio.Button>
|
|
|
- <Radio.Button value="chengdu">Chengdu</Radio.Button>
|
|
|
+ <Radio.Button value="guangzhou"><FormattedMessage id="Guangzhou"/></Radio.Button>
|
|
|
+ <Radio.Button value="shanghai"><FormattedMessage id="Shanghai"/></Radio.Button>
|
|
|
+ <Radio.Button value="beijing"><FormattedMessage id="Beijing"/></Radio.Button>
|
|
|
+ <Radio.Button value="chengdu"><FormattedMessage id="Chengdu"/></Radio.Button>
|
|
|
</Radio.Group>
|
|
|
</div>
|
|
|
<Collapse bordered={false}>
|
|
|
- <Panel header="Want more options?" style={customPanelStyle}>
|
|
|
+ <Panel header=<FormattedMessage id="Want more options?"/> style={customPanelStyle}>
|
|
|
<div style={{marginBottom: 10}}>
|
|
|
- <span className='vice-title'>{valueToKey['cosBucketRegion']}
|
|
|
+ <span className='vice-title'><FormattedMessage id={valueToKey['cosBucketRegion']}/>
|
|
|
|
|
|
<Tooltip placement="top" title={toolTipTitle['cosBucketRegion']}>
|
|
|
<Icon type="question-circle"/>
|
|
|
@@ -260,10 +261,10 @@ class DeployCard extends Component {
|
|
|
this.props.switchRegion(e);
|
|
|
}} defaultValue={this.state.region}
|
|
|
value={removePrefix('ap-', this.state.cosBucketRegion)} buttonStyle="solid">
|
|
|
- <Radio.Button value="guangzhou">Guangzhou</Radio.Button>
|
|
|
- <Radio.Button value="shanghai">Shanghai</Radio.Button>
|
|
|
- <Radio.Button value="beijing">Beijing</Radio.Button>
|
|
|
- <Radio.Button value="chengdu">Chengdu</Radio.Button>
|
|
|
+ <Radio.Button value="guangzhou"><FormattedMessage id="Guangzhou"/></Radio.Button>
|
|
|
+ <Radio.Button value="shanghai"><FormattedMessage id="Shanghai"/></Radio.Button>
|
|
|
+ <Radio.Button value="beijing"><FormattedMessage id="Beijing"/></Radio.Button>
|
|
|
+ <Radio.Button value="chengdu"><FormattedMessage id="Chengdu"/></Radio.Button>
|
|
|
</Radio.Group>
|
|
|
</div>
|
|
|
{/*腾讯云为空字符串,不显示,这里未作区分*/}
|
|
|
@@ -280,7 +281,7 @@ class DeployCard extends Component {
|
|
|
{
|
|
|
this.state.configs.map(config => (
|
|
|
<div key={config} style={{marginBottom: 10}}>
|
|
|
- <span className='vice-title'>{valueToKey[config]}
|
|
|
+ <span className='vice-title'><FormattedMessage id={valueToKey[config]}/>
|
|
|
|
|
|
<Tooltip placement="top" title={toolTipTitle[config]}>
|
|
|
<Icon type="question-circle"/>
|
|
|
@@ -301,7 +302,7 @@ class DeployCard extends Component {
|
|
|
const id = idGen('deploy');
|
|
|
this.ok(id);
|
|
|
this.props.pass(id, 'deploy');
|
|
|
- }} type='primary'>save</Button>
|
|
|
+ }} type='primary'><FormattedMessage id="save"/></Button>
|
|
|
{
|
|
|
this.state.showOK === true ?
|
|
|
<Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
|
|
|
@@ -318,7 +319,7 @@ class DeployCard extends Component {
|
|
|
const id = idGen('deploy');
|
|
|
this.ok(id);
|
|
|
this.props.pass(id, 'deploy');
|
|
|
- }} type='primary'>save</Button>
|
|
|
+ }} type='primary'><FormattedMessage id="save"/></Button>
|
|
|
{
|
|
|
this.state.showOK === true ?
|
|
|
<Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
|