Skip to content

Commit

Permalink
CA Management: content bilingual。 blockchain-desktop#202
Browse files Browse the repository at this point in the history
Signed-off-by: Yi DENG <[email protected]>
  • Loading branch information
dengyi9 committed Mar 27, 2019
1 parent bc5a2d5 commit 42f15ce
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
11 changes: 11 additions & 0 deletions src/common/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,18 @@ Common.LOGIN_ORDERER_SSL_TARGET = 'Orderer SSL Target';
Common.LOGIN_CA_SERVER_URL = 'CA Server Url';

// user register page
Common.REGISTER = 'REGISTER';
Common.REGISTER_USERNAME = 'User Name';
Common.REGISTER_AFFILIATION = 'Affiliation';
Common.REGISTER_ROLE = 'Role';
Common.REGISTER_OPTIONAL = 'Optional';
Common.REGISTER_CONFIRM = 'Register';

Common.ENROLL = 'ENROLLMENT';
Common.ENROLL_USERNAME = 'User Name';
Common.ENROLL_PASSWORD = 'Password';
Common.ENROLL_OPTIONAL = 'Optional';
Common.ENROLL_CONFIRM = 'Get';

Common.WARN = {
chaincodeName: 'chaincode name can not be null!',
Expand Down
11 changes: 11 additions & 0 deletions src/common/common_cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,18 @@ Common.LOGIN_ORDERER_SSL_TARGET = '排序节点SSL域名';
Common.LOGIN_CA_SERVER_URL = 'CA节点地址';

// user register page
Common.REGISTER = '注册';
Common.REGISTER_USERNAME = '用户名';
Common.REGISTER_AFFILIATION = '组织归属';
Common.REGISTER_ROLE = '角色类型';
Common.REGISTER_OPTIONAL = '其他属性';
Common.REGISTER_CONFIRM = '注册';

Common.ENROLL = '证书私钥获取';
Common.ENROLL_USERNAME = '用户名';
Common.ENROLL_PASSWORD = '密码';
Common.ENROLL_OPTIONAL = '其他属性';
Common.ENROLL_CONFIRM = '获取';

Common.WARN = {
chaincodeName: '链码名称不能为空!',
Expand Down
21 changes: 10 additions & 11 deletions src/components/content/CARegisterContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { getFabricClientSingleton } from '../../util/fabric';
const { TextArea } = Input;
const logger = require('electron-log');

// TODO: 多语言支持
/**
* register参数:用户名、affiliation, role等等
* enroll参数:用户名、密码
Expand Down Expand Up @@ -191,28 +190,28 @@ export default class CARegisterContent extends React.Component {
return (
<div style={outerDivStyle}>

<div>注册</div>
<div>{this.state.Common.REGISTER}</div>
<div style={DivStyle}>
<span style={asteriskStyle}>*</span>
<span style={spanStyle}>{this.state.Common.REGISTER_USERNAME}</span>
<Input placeholder="User Name" style={configInputStyle} value={this.state.registerUserName} onChange={this.onChangeRegisterUserName} />
</div>
<div style={DivStyle}>
<span style={asteriskStyle}>*</span>
<span style={spanStyle}>组织归属</span>
<span style={spanStyle}>{this.state.Common.REGISTER_AFFILIATION}</span>
<Input placeholder="eg. org1.department" style={configInputStyle} value={this.state.registerAffiliation} onChange={this.onChangeRegisterAffiliation} />
</div>
<div style={DivStyle}>
<span style={asteriskStyle}>*</span>
<span style={spanStyle}>角色类型</span>
<span style={spanStyle}>{this.state.Common.REGISTER_ROLE}</span>
<Input placeholder="eg. client/peer/orderer/user/app" style={configInputStyle} value={this.state.registerRole} onChange={this.onChangeRegisterRole} />
</div>
<div style={DivStyle}>
<span style={spanStyle}>其他属性</span>
<span style={spanStyle}>{this.state.Common.REGISTER_OPTIONAL}</span>
<Input placeholder="Optional json parameters" style={configInputStyle} value={this.state.registerOptional} onChange={this.onChangeRegisterOptional} />
</div>
<div style={DivStyle}>
<Button style={ButtonStyle} type="primary" onClick={this.handleRegister}>注册</Button>
<Button style={ButtonStyle} type="primary" onClick={this.handleRegister}>{this.state.Common.REGISTER_CONFIRM}</Button>
<TextArea
placeholder="Register Result: Password"
value={this.state.registerResult}
Expand All @@ -221,23 +220,23 @@ export default class CARegisterContent extends React.Component {
/>
</div>

<div >证书私钥领取</div>
<div >{this.state.Common.ENROLL}</div>
<div style={DivStyle}>
<span style={asteriskStyle}>*</span>
<span style={spanStyle}>用户名</span>
<span style={spanStyle}>{this.state.Common.ENROLL_USERNAME}</span>
<Input placeholder="User Name" style={configInputStyle} value={this.state.enrollUserName} onChange={this.onChangeEnrollUserName} />
</div>
<div style={DivStyle}>
<span style={asteriskStyle}>*</span>
<span style={spanStyle}>密码</span>
<span style={spanStyle}>{this.state.Common.ENROLL_PASSWORD}</span>
<Input placeholder="Password" style={configInputStyle} value={this.state.enrollUserPassword} onChange={this.onChangeEnrollUserPassword} />
</div>
<div style={DivStyle}>
<span style={spanStyle}>其他属性</span>
<span style={spanStyle}>{this.state.Common.ENROLL_OPTIONAL}</span>
<Input placeholder="Optional json parameters" style={configInputStyle} value={this.state.enrollOptional} onChange={this.onChangeEnrollOptional} />
</div>
<div style={DivStyle}>
<Button style={ButtonStyle} type="primary" onClick={this.handleEnroll}>领取</Button>
<Button style={ButtonStyle} type="primary" onClick={this.handleEnroll}>{this.state.Common.ENROLL_CONFIRM}</Button>
<TextArea
placeholder="Enroll Result"
value={this.state.enrollResult}
Expand Down

0 comments on commit 42f15ce

Please sign in to comment.