xy 7 лет назад
Родитель
Сommit
3b902190d5

+ 1 - 1
src/app/App.jsx

@@ -498,7 +498,7 @@ class WxConfigSiderbar extends Component {
                                 </Menu.Item>
 
                                 <SubMenu key="my-create" title={<span><Icon type="user" theme="outlined"/><span><FormattedMessage
-                                    id="My Create"/>My Create</span></span>}>
+                                    id="My Create"/></span></span>}>
                                     {
                                         data.userWxConfig.map((config) =>
                                             <Menu.Item key={config.appName}>

+ 1 - 1
src/app/common/deploy/tencent/APIGroupCard.js

@@ -5,7 +5,7 @@ import {request} from 'graphql-request'
 import {idGen} from "../../../../func";
 import {graphqlUrl} from "../../../../config";
 import {manageUsers} from "../../../../config";
-
+import {FormattedMessage} from 'react-intl';
 const Panel = Collapse.Panel;
 
 

+ 8 - 5
src/app/common/deploy/tencent/TencentConfig.js

@@ -8,6 +8,7 @@ import NotificationCard from './NotificationCard';
 import {SHOW_DEPLOY, SHOW_APIGWGROUP, SHOW_APIGWPATH} from "../../../../gql";
 import {request} from 'graphql-request'
 import {graphqlUrl} from "../../../../config";
+import {FormattedMessage} from 'react-intl';
 
 class TencentConfig extends Component {
     constructor(props) {
@@ -99,13 +100,15 @@ class TencentConfig extends Component {
                 <div style={{padding: '30px'}}>
                     <Row gutter={16}>
                         <Col span={14}>
-                            <Card title="Deploy" style={{marginBottom: 10}}><DeployCard deploy={this.state.currentDeploy} switchRegion={this.switchRegion} region={this.state.region} defalutName={this.props.defalutName} userID={this.props.userID} cloudID={this.props.cloudID} pass={this.pass} kind={this.props.kind} trialcase={this.props.trialcase}/></Card>
-                            <Card title="API Group" style={{marginBottom: 10}}><APIGroupCard group={this.state.currentGroup} switchRegion={this.switchRegion} region={this.state.region} userID={this.props.userID} cloudID={this.props.cloudID} pass={this.pass} kind={this.props.kind} trialcase={this.props.trialcase}/></Card>
-                            <Card title="API Path" style={{marginBottom: 10}}><APIPathCard path={this.state.currentPath} defalutName={this.props.defalutName} userID={this.props.userID} deployID={this.state.currentDeploy? this.state.currentDeploy.id : this.state.deployIdPassToPath} groupID={this.state.currentGroup? this.state.currentGroup.id : this.state.groupIdPassToPath} trialcase={this.props.trialcase}/></Card>
-                            <Card title="Notification"><NotificationCard userID={this.props.userID} trialcase={this.props.trialcase}/></Card>
+                            <FormattedMessage id="Deploy">{msg => <Card title={msg} style={{marginBottom: 10}}><DeployCard deploy={this.state.currentDeploy} switchRegion={this.switchRegion} region={this.state.region} defalutName={this.props.defalutName} userID={this.props.userID} cloudID={this.props.cloudID} pass={this.pass} kind={this.props.kind} trialcase={this.props.trialcase}/></Card>}</FormattedMessage>
+                            <FormattedMessage id="API Group">{msg => <Card title={msg} style={{marginBottom: 10}}><APIGroupCard group={this.state.currentGroup} switchRegion={this.switchRegion} region={this.state.region} userID={this.props.userID} cloudID={this.props.cloudID} pass={this.pass} kind={this.props.kind} trialcase={this.props.trialcase}/></Card>}</FormattedMessage>
+                            <FormattedMessage id="API Path">{msg => <Card title={msg} style={{marginBottom: 10}}><APIPathCard path={this.state.currentPath} defalutName={this.props.defalutName} userID={this.props.userID} deployID={this.state.currentDeploy? this.state.currentDeploy.id : this.state.deployIdPassToPath} groupID={this.state.currentGroup? this.state.currentGroup.id : this.state.groupIdPassToPath} trialcase={this.props.trialcase}/></Card>}</FormattedMessage>
+                            <FormattedMessage id="Notification">{msg => <Card title={msg}><NotificationCard userID={this.props.userID} trialcase={this.props.trialcase}/></Card>}</FormattedMessage>
+
+
                         </Col>
                         <Col offset={2} span={6}>
-                            <Button type='primary'>deploy!</Button>
+                            <Button type='primary'><FormattedMessage id="deploy"/>!</Button>
                         </Col>
                     </Row>
                 </div>

+ 32 - 26
src/app/graphqlService/component/schema/Schema.jsx

@@ -229,7 +229,8 @@ class Schema extends Component {
                                             <div className={'schema-table-list-title'}>
                                                 <Row>
                                                     <Col span={10}><span
-                                                        className={'schema-table-title'}><FormattedMessage id="Name"/></span></Col>
+                                                        className={'schema-table-title'}><FormattedMessage
+                                                        id="Name"/></span></Col>
                                                     <Col span={10}><span
                                                         className={'schema-table-title'}><FormattedMessage id="Remark"/></span></Col>
                                                     <Col span={2} offset={2}>
@@ -277,7 +278,8 @@ class Schema extends Component {
                                                                             className={'schema-table-content name'}>{table.name}</span>
                                                                     </Col>
                                                                     <Col span={10}>
-                                                                        <span className={'schema-table-content'}>{table.remark}</span>
+                                                                        <span
+                                                                            className={'schema-table-content'}>{table.remark}</span>
                                                                     </Col>
                                                                     <Col span={2} offset={2}>
 
@@ -708,30 +710,34 @@ class ModifySchemaNameInput extends Component {
                         return <Spin style={{marginLeft: 3}}/>;
                     return (
                         <div className={'schema'}>
-                            <Search
-                                value={this.props.editSchemaName}
-                                enterButton="Confirm"
-                                style={{width: 500}}
-                                size="large"
-                                onChange={this.props.changeEditSchemaName}
-                                onSearch={value => {
-                                    update_schema({
-                                        variables: {
-                                            id: this.props.schemaID,
-                                            schemaName: value,
-                                            updateAt: new Date().getTime()
-                                        }
-                                    });
-                                    this.props.history.push({
-                                        pathname: `/graphql-service/my-create/${value}`,
-                                        state: {
-                                            schemaName: value,
-                                            schemaID: this.props.schemaID,
-                                        }
-                                    });
-                                    this.props.clearEditSchemaName();
-                                }}
-                            />
+                            <FormattedMessage id="Confirm">
+                                {(msg) => (
+                                    <Search
+                                        value={this.props.editSchemaName}
+                                        enterButton={msg}
+                                        style={{width: 500}}
+                                        size="large"
+                                        onChange={this.props.changeEditSchemaName}
+                                        onSearch={value => {
+                                            update_schema({
+                                                variables: {
+                                                    id: this.props.schemaID,
+                                                    schemaName: value,
+                                                    updateAt: new Date().getTime()
+                                                }
+                                            });
+                                            this.props.history.push({
+                                                pathname: `/graphql-service/my-create/${value}`,
+                                                state: {
+                                                    schemaName: value,
+                                                    schemaID: this.props.schemaID,
+                                                }
+                                            });
+                                            this.props.clearEditSchemaName();
+                                        }}
+                                    />)}
+                            </FormattedMessage>
+
                         </div>
                     )
                 }}

+ 30 - 20
src/app/graphqlService/component/schema/Table.js

@@ -130,24 +130,30 @@ class Table extends Component {
                     <Content style={{padding: '24px', minHeight: 280, background: '#fff'}}>
                         <div className="column-content">
                             <span className='table-title'> <FormattedMessage id="Table name"/></span>
-                            <Input
-                                value={this.state.currentTable}
-                                placeholder="please input table name"
-                                style={{width: 200, margin: '10px 0'}}
-                                onChange={(e) => {
-                                    this.setState({currentTable: e.target.value})
-                                }}/>
+                            <FormattedMessage id="please input table name">
+                                {(msg) => (<Input
+                                    value={this.state.currentTable}
+                                    placeholder={msg}
+                                    style={{width: 200, margin: '10px 0'}}
+                                    onChange={(e) => {
+                                        this.setState({currentTable: e.target.value})
+                                    }}/>)}
+                            </FormattedMessage>
+
                         </div>
 
                         <div style={{marginBottom: 20}}>
                             <span className='table-title'> <FormattedMessage id="Table remark"/></span>
-                            <Input
-                                value={this.state.remark}
-                                placeholder="please input table remark"
-                                style={{width: 250, margin: '10px 0'}}
-                                onChange={(e) => {
-                                    this.setState({remark: e.target.value})
-                                }}/>
+                            <FormattedMessage id="please input table remark">
+                                {(msg) => (<Input
+                                    value={this.state.remark}
+                                    placeholder={msg}
+                                    style={{width: 250, margin: '10px 0'}}
+                                    onChange={(e) => {
+                                        this.setState({remark: e.target.value})
+                                    }}/>)}
+                            </FormattedMessage>
+
                         </div>
 
                         <div>
@@ -200,12 +206,15 @@ class Table extends Component {
                                 )
                             }
                             <div>
-                                <Input
-                                    className="column-details"
-                                    placeholder="field name"
-                                    onChange={this.handleNameNew}
-                                    value={this.state.newColName}
-                                />
+                                <FormattedMessage id="field name">
+                                    {(msg) => (<Input
+                                        className="column-details"
+                                        placeholder={msg}
+                                        onChange={this.handleNameNew}
+                                        value={this.state.newColName}
+                                    />)}
+                                </FormattedMessage>
+
                                 <Select
                                     className="column-details"
                                     defaultValue="type"
@@ -358,6 +367,7 @@ class UpdateTableButton extends Component {
                                     else schemaCols = JSON.parse(schemaData.schema_by_id.schemaData);
 
                                     // 处理一下description的问题
+
                                     let cols = this.props.columns;
                                     cols.map(obj => {
                                         if (obj.description === 'description')

+ 11 - 0
src/language/en_US.js

@@ -27,5 +27,16 @@ const en_US = {
     "name": "name",
     "type": "type",
     "description": "description",
+    "config": "config",
+    "result": "result",
+    "please input table remark": "please input table remark",
+    "please input table name": "please input table name",
+    "field name": 'field name',
+    "Confirm": '确认修改',
+    "Deploy": 'Deploy',
+    "API Group": 'API Group',
+    "API Path": 'API Path',
+    "Notification": 'Notification',
+    "Want more options?": 'Want more options?',
 };
 export default en_US;

+ 13 - 2
src/language/zh_CN.js

@@ -22,10 +22,21 @@ const zh_CN = {
     "delete": "删除",
     "Login": "登录",
     "Table name": "表名",
-    "Table remark": "表描述",
-    "Table fields": "内容",
+    "Table remark": "表备注",
+    "Table fields": "字段内容",
     "name": "名称",
     "type": "类型",
     "description": "描述",
+    "config": "配置",
+    "result": "结果",
+    "please input table remark": "请输入表备注",
+    "please input table name": "请输入表名",
+    "field name": '字段名',
+    "Confirm": '确认修改',
+    "Deploy": '部署配置',
+    "API Group": 'API组 配置',
+    "API Path": 'API路径 配置',
+    "Notification": '通知配置',
+    "Want more options?": '需要更多配置项?',
 };
 export default zh_CN;