Skip to content
This repository was archived by the owner on Aug 24, 2019. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f95c60b

Browse files
committedFeb 26, 2017
fix password
1 parent dbd7727 commit f95c60b

File tree

20 files changed

+189
-511
lines changed

20 files changed

+189
-511
lines changed
 

‎src/components/AccessKeys/AccessKeys.css

Lines changed: 0 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -16,172 +16,5 @@
1616
table{
1717
font-size: 1.2em;
1818
width: 100%;
19-
border-collapse: collapse;
20-
color: #666;
21-
margin-top: 20px;
2219
text-align: center;
2320
}
24-
25-
th,td {
26-
padding: 10px 0;
27-
font-weight: normal;
28-
border: 1px solid #CACACA;
29-
a{
30-
width: 100%;
31-
color: $main-color;
32-
}
33-
}
34-
35-
th {
36-
background-color: #EEEFFE;
37-
}
38-
39-
.btn {
40-
display: inline-block;
41-
padding: 6px 12px;
42-
margin-bottom: 0;
43-
font-size: 14px;
44-
font-weight: normal;
45-
line-height: 1.42857143;
46-
text-align: center;
47-
white-space: nowrap;
48-
vertical-align: middle;
49-
-ms-touch-action: manipulation;
50-
touch-action: manipulation;
51-
cursor: pointer;
52-
-webkit-user-select: none;
53-
-moz-user-select: none;
54-
-ms-user-select: none;
55-
user-select: none;
56-
background-image: none;
57-
border: 1px solid transparent;
58-
border-radius: 4px;
59-
}
60-
.btn:focus,
61-
.btn.active.focus {
62-
outline: thin dotted;
63-
outline: 5px auto -webkit-focus-ring-color;
64-
outline-offset: -2px;
65-
}
66-
.btn:hover,
67-
.btn.focus {
68-
color: #333;
69-
text-decoration: none;
70-
}
71-
.btn.active {
72-
background-image: none;
73-
outline: 0;
74-
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
75-
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
76-
}
77-
.btn.disabled,
78-
.btn[disabled],
79-
fieldset[disabled] .btn {
80-
cursor: not-allowed;
81-
filter: alpha(opacity=65);
82-
-webkit-box-shadow: none;
83-
box-shadow: none;
84-
opacity: .65;
85-
}
86-
.btnDanger {
87-
color: #fff;
88-
background-color: #d9534f;
89-
border-color: #d43f3a;
90-
}
91-
.btnDanger.focus {
92-
color: #fff;
93-
background-color: #c9302c;
94-
border-color: #761c19;
95-
}
96-
.btnDanger:hover {
97-
color: #fff;
98-
background-color: #c9302c;
99-
border-color: #ac2925;
100-
}
101-
.btnDanger:active,
102-
.btnDanger.active:hover,
103-
.btnDanger.active:focus {
104-
color: #fff;
105-
background-color: #ac2925;
106-
border-color: #761c19;
107-
}
108-
.btnDanger.disabled,
109-
.btnDanger[disabled],
110-
fieldset[disabled] .btnDanger,
111-
.btnDanger.disabled:hover,
112-
.btnDanger[disabled]:hover,
113-
fieldset[disabled] .btnDanger:hover,
114-
.btnDanger.disabled:focus,
115-
.btnDanger[disabled]:focus,
116-
fieldset[disabled] .btnDanger:focus,
117-
.btnDanger.disabled.focus,
118-
.btnDanger[disabled].focus,
119-
fieldset[disabled] .btnDanger.focus,
120-
.btnDanger.disabled:active,
121-
.btnDanger[disabled]:active,
122-
fieldset[disabled] .btnDanger:active,
123-
.btnDanger.disabled.active,
124-
.btnDanger[disabled].active,
125-
fieldset[disabled] .btnDanger.active {
126-
background-color: #d9534f;
127-
border-color: #d43f3a;
128-
}
129-
.btnDanger .badge {
130-
color: #d9534f;
131-
background-color: #fff;
132-
}
133-
134-
.btnPrimary {
135-
color: #fff;
136-
background-color: #337ab7;
137-
border-color: #2e6da4;
138-
}
139-
.btnPrimary.focus {
140-
color: #fff;
141-
background-color: #286090;
142-
border-color: #122b40;
143-
}
144-
.btnPrimary:hover {
145-
color: #fff;
146-
background-color: #286090;
147-
border-color: #204d74;
148-
}
149-
.btnPrimary:active {
150-
color: #fff;
151-
background-color: #286090;
152-
border-color: #204d74;
153-
}
154-
.btnPrimary:active:hover,
155-
.btnPrimary:active:focus {
156-
color: #fff;
157-
background-color: #204d74;
158-
border-color: #122b40;
159-
}
160-
.btnPrimary:active {
161-
background-image: none;
162-
}
163-
.btnPrimary.disabled,
164-
.btnPrimary[disabled],
165-
fieldset[disabled] .btnPrimary,
166-
.btnPrimary.disabled:hover,
167-
.btnPrimary[disabled]:hover,
168-
fieldset[disabled] .btnPrimary:hover,
169-
.btnPrimary.disabled:focus,
170-
.btnPrimary[disabled]:focus,
171-
fieldset[disabled] .btnPrimary:focus,
172-
.btnPrimary.disabled.focus,
173-
.btnPrimary[disabled].focus,
174-
fieldset[disabled] .btnPrimary.focus,
175-
.btnPrimary.disabled:active,
176-
.btnPrimary[disabled]:active,
177-
fieldset[disabled] .btnPrimary:active,
178-
.btnPrimary.disabled.active,
179-
.btnPrimary[disabled].active,
180-
fieldset[disabled] .btnPrimary.active {
181-
background-color: #337ab7;
182-
border-color: #2e6da4;
183-
}
184-
.btnPrimary .badge {
185-
color: #337ab7;
186-
background-color: #fff;
187-
}

‎src/components/AccessKeys/AccessKeys.js

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import React, { PropTypes, Component } from 'react';
3+
import {Breadcrumb, Table, Button} from 'react-bootstrap';
34
import withStyles from 'isomorphic-style-loader/lib/withStyles';
45
import s from './AccessKeys.css';
56
import cx from 'classnames';
@@ -58,12 +59,12 @@ class AccessKeys extends Component {
5859
<td>{moment(_.get(rowData, 'createdTime')).fromNow()}</td>
5960
<td>{moment(_.get(rowData, 'expires')).fromNow()}</td>
6061
<td>
61-
<button
62+
<Button
6263
onClick={()=>{self.props.removeKey(_.get(rowData, 'friendlyName'))}}
63-
className={cx(s.btn,s.btnDanger)}
64+
bsStyle="danger"
6465
>
6566
移除
66-
</button>
67+
</Button>
6768
</td>
6869
</tr>
6970
);
@@ -77,36 +78,41 @@ class AccessKeys extends Component {
7778
}
7879
return (
7980
<div className={s.root}>
80-
{
81-
this.props.isShowKey ?
8281
<PopShowKey
83-
value={this.props.token}
84-
close={this.props.close}
82+
showModal={this.props.isShowKey}
83+
value={this.props.token}
84+
close={this.props.close}
8585
/>
86-
: null
87-
}
8886
<div className={s.container}>
89-
<h1>密钥列表</h1>
87+
<Breadcrumb>
88+
<Breadcrumb.Item active={true}>
89+
密钥列表
90+
</Breadcrumb.Item>
91+
</Breadcrumb>
9092
<span style={{ float:'right', marginBottom:'20px', marginRight:'20px' }}>
91-
<button
93+
<Button
9294
onClick={()=>{
9395
self.props.createKey();
9496
}}
95-
className={cx(s.btn,s.btnPrimary)} disabled={this.props.isCreating ? true:false } >
97+
bsStyle="primary"
98+
disabled={this.props.isCreating ? true:false }
99+
>
96100
创建key
97-
</button>
101+
</Button>
98102
</span>
99-
<table>
100-
<tbody>
103+
<Table striped bordered condensed hover>
104+
<thead>
101105
<tr>
102-
<th>名字</th>
103-
<th>创建者</th>
104-
<th>类型</th>
105-
<th>创建时间</th>
106-
<th>过期时间</th>
107-
<th>操作</th>
106+
<th style={{ textAlign:'center' }} >名字</th>
107+
<th style={{ textAlign:'center' }} >创建者</th>
108+
<th style={{ textAlign:'center' }} >类型</th>
109+
<th style={{ textAlign:'center' }} >创建时间</th>
110+
<th style={{ textAlign:'center' }} >过期时间</th>
111+
<th style={{ textAlign:'center' }} >操作</th>
108112
</tr>
109-
{
113+
</thead>
114+
<tbody>
115+
{
110116
this.props.rs.length > 0 ?
111117
_.map(this.props.rs, function (item, index) {
112118
return self.renderRow(item, index);
@@ -117,7 +123,7 @@ class AccessKeys extends Component {
117123
</tr>
118124
}
119125
</tbody>
120-
</table>
126+
</Table>
121127
</div>
122128
</div>
123129
);

‎src/components/AccessKeys/PopShowKey/PopShowKey.css

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11

22
import React, { PropTypes, Component } from 'react';
3-
import withStyles from 'isomorphic-style-loader/lib/withStyles';
4-
import s from './PopShowKey.css';
5-
import cx from 'classnames';
6-
import _ from 'lodash';
7-
import Modal from '../../Modal';
3+
import {Modal, Button, FormGroup, FormControl, HelpBlock} from 'react-bootstrap';
84

95
class PopShowKey extends Component {
106
static propTypes = {
117
value: PropTypes.string,
128
close: PropTypes.func,
9+
showModal: PropTypes.bool,
1310
};
1411

1512
static defaultProps = {
1613
value: '',
14+
showModal: false,
1715
close: ()=>{},
1816
};
1917

@@ -28,29 +26,34 @@ class PopShowKey extends Component {
2826

2927
render() {
3028
return (
31-
<Modal>
32-
<div className={s.root}>
33-
<a href="javascript:;" onClick={this.close} className={s.close}>x</a>
34-
<h3>复制下面的密钥, 然后关闭弹框</h3>
35-
<p>
36-
<input
37-
value={this.props.value}
38-
onFocus={(event)=>{
39-
event.target.select();
40-
}}
41-
onClick={(event)=>{
42-
event.target.select();
43-
}}
44-
onMouseOver={(event)=>{
45-
event.target.select();
46-
}}
47-
readOnly
29+
<Modal show={this.props.showModal} onHide={this.close}>
30+
<Modal.Header closeButton>
31+
<Modal.Title>创建密钥成功</Modal.Title>
32+
</Modal.Header>
33+
<Modal.Body>
34+
<FormGroup validationState="success">
35+
<FormControl
36+
value={this.props.value}
37+
onFocus={(event)=>{
38+
event.target.select();
39+
}}
40+
onClick={(event)=>{
41+
event.target.select();
42+
}}
43+
onMouseOver={(event)=>{
44+
event.target.select();
45+
}}
46+
readOnly
47+
type="text"
4848
/>
49-
</p>
50-
<p><button className={s.btn} onClick={this.close} >关闭</button></p>
51-
</div>
49+
<HelpBlock>复制上面的密钥, 然后关闭弹框</HelpBlock>
50+
</FormGroup>
51+
</Modal.Body>
52+
<Modal.Footer>
53+
<Button onClick={this.close}>关闭</Button>
54+
</Modal.Footer>
5255
</Modal>
5356
)
5457
}
5558
}
56-
export default withStyles(s)(PopShowKey);
59+
export default PopShowKey;
-1.16 KB
Binary file not shown.
Lines changed: 99 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11

22
import React, { PropTypes, Component } from 'react';
3-
import withStyles from 'isomorphic-style-loader/lib/withStyles';
4-
import s from './ChangePassword.css';
3+
import {
4+
Col,
5+
ControlLabel,
6+
Form,
7+
FormGroup,
8+
FormControl,
9+
Checkbox,
10+
Button,
11+
Panel,
12+
} from 'react-bootstrap';
13+
514
import _ from 'lodash';
6-
import Link from '../Link';
7-
import Button from '../Button';
8-
import moment from 'moment';
915

1016
class ChangePassword extends Component {
1117
static propTypes = {
@@ -53,7 +59,7 @@ class ChangePassword extends Component {
5359
}
5460

5561
render() {
56-
let self = this;
62+
const self = this;
5763
let isValidate = true;
5864
let oldPasswordTips = '';
5965
if (!this.props.oldPassword) {
@@ -69,88 +75,96 @@ class ChangePassword extends Component {
6975
isValidate = false;
7076
newPasswordConfirmTips = '两次输入的密码不一致'
7177
}
72-
78+
var disabled = true;
79+
if (!this.props.isFetching && isValidate){
80+
disabled = false;
81+
}
7382
return (
74-
<div className={s.root}>
75-
<div className={s.container}>
76-
<div className={s.formGroup}>
77-
<label className={s.label} htmlFor="oldPassword">
78-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;旧密码:
79-
</label>
80-
<input
81-
className={s.input}
82-
onChange={this.setOldPassword}
83-
id="oldPassword"
84-
type="password"
85-
value={this.props.oldPassword}
86-
placeholder="请输入旧密码"
87-
autoFocus
88-
onBlur={()=>this.setState({field1: true})}
89-
/>
90-
</div>
91-
{
92-
this.state.field1 ?
93-
<div className={s.errorTip}>{oldPasswordTips}</div>
94-
: null
95-
}
96-
<div className={s.formGroup}>
97-
<label className={s.label} htmlFor="newPassword">
98-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;新密码:
99-
</label>
100-
<input
101-
className={s.input}
102-
onChange={this.setNewPassword}
103-
id="newPassword"
104-
type="password"
105-
value={this.props.newPassword}
106-
placeholder="请您输入新的密码"
107-
onBlur={()=>this.setState({field2: true})}
108-
/>
109-
</div>
110-
{
111-
this.state.field2 ?
112-
<div className={s.errorTip}>{newPasswordTips}</div>
113-
: null
114-
}
115-
<div className={s.formGroup}>
116-
<label className={s.label} htmlFor="newPasswordConfirm">
117-
确认新密码:
118-
</label>
119-
<input
120-
className={s.input}
121-
onChange={this.setNewPasswordConfirm}
122-
id="newPasswordConfirm"
123-
type="password"
124-
value={this.props.newPasswordConfirm}
125-
placeholder="请您再次输入新的密码"
126-
onBlur={()=>this.setState({field3: true})}
127-
/>
128-
</div>
129-
{
130-
this.state.field3 ?
131-
<div className={s.errorTip}>{newPasswordConfirmTips}</div>
132-
: null
133-
}
134-
<br/>
135-
<div className={s.errorTip}>{_.get(this.props, 'error.message')}</div>
136-
<div className={s.formGroup}>
137-
<Button
138-
style={
139-
this.props.isFetching || !isValidate ?
140-
{ width:'71%', marginLeft: '27%', backgroundColor:'grey' }
141-
: { width:'71%', marginLeft: '27%' }
83+
<div style={{height:650, paddingLeft: 20, paddingRight:20 }}>
84+
<Panel header="修改密码" style={{ maxWidth:350, marginLeft:"auto", marginRight: "auto" }}>
85+
<Form>
86+
<FormGroup>
87+
<ControlLabel>原密码</ControlLabel>
88+
<FormControl
89+
onChange={this.setOldPassword}
90+
type="password"
91+
value={this.props.oldPassword}
92+
placeholder="请输入原密码"
93+
onBlur={()=>this.setState({field1: true})}
94+
autoFocus
95+
/>
96+
</FormGroup>
97+
<FormGroup>
98+
<div style={{ color:'red' }} >
99+
{
100+
this.state.field1 ?
101+
oldPasswordTips
102+
: null
103+
}
104+
</div>
105+
</FormGroup>
106+
<FormGroup>
107+
<ControlLabel>新密码</ControlLabel>
108+
<FormControl
109+
onChange={this.setNewPassword}
110+
type="password"
111+
value={this.props.newPassword}
112+
placeholder="请您输入新的密码"
113+
onBlur={()=>this.setState({field2: true})}
114+
/>
115+
</FormGroup>
116+
<FormGroup>
117+
<div style={{ color:'red' }} >
118+
{
119+
this.state.field2 ?
120+
newPasswordTips
121+
: null
122+
}
123+
</div>
124+
</FormGroup>
125+
<FormGroup>
126+
<ControlLabel>确认新密码</ControlLabel>
127+
<FormControl
128+
onChange={this.setNewPasswordConfirm}
129+
type="password"
130+
value={this.props.newPasswordConfirm}
131+
placeholder="请您再次输入新的密码"
132+
onBlur={()=>this.setState({field3: true})}
133+
/>
134+
</FormGroup>
135+
<FormGroup>
136+
<div style={{ color:'red' }} >
137+
{
138+
this.state.field3 ?
139+
newPasswordConfirmTips
140+
: null
142141
}
143-
value="确认"
144-
onClick={()=>{
145-
if (self.props.isFetching || !isValidate) {
146-
return;
147-
}
148-
self.props.submit();
149-
}}/>
150-
</div>
151-
</div>
142+
</div>
143+
</FormGroup>
144+
<FormGroup style={{ paddingTop: 20 }}>
145+
<div style={{ color:'red' }} >
146+
{_.get(this.props, 'error.message')}
147+
</div>
148+
</FormGroup>
149+
<FormGroup>
150+
<Button
151+
style={{width: "100%"}}
152+
bsStyle="primary"
153+
disabled={disabled}
154+
onClick={()=>{
155+
if (disabled) {
156+
return;
157+
}
158+
self.props.submit();
159+
}}
160+
>
161+
确认
162+
</Button>
163+
</FormGroup>
164+
</Form>
165+
</Panel>
152166
</div>
153167
);
154168
}
155169
}
156-
export default withStyles(s)(ChangePassword);
170+
export default ChangePassword;

‎src/components/Countdown/Countdown.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, {PropTypes, Component} from 'react';
2-
import moment from 'moment';
32
import _ from 'lodash';
43

54
export default class Countdown extends Component {

‎src/components/Feedback/Feedback.css

Lines changed: 0 additions & 40 deletions
This file was deleted.

‎src/components/Feedback/Feedback.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

‎src/components/Feedback/package.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎src/components/Header/logo-small.png

-2.77 KB
Binary file not shown.
-6.65 KB
Binary file not shown.

‎src/components/Login/Login.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ class Login extends Component {
5555
render() {
5656
return (
5757
<div style={{height:650, paddingLeft: 20, paddingRight:20 }}>
58-
<Panel header="登录" style={{ width:350, marginLeft:"auto", marginRight: "auto" }}>
58+
<Panel header="登录" style={{ maxWidth:350, marginLeft:"auto", marginRight: "auto" }}>
5959
<Form>
60-
<FormGroup controlId="formHorizontalEmail">
60+
<FormGroup>
6161
<ControlLabel>邮箱地址</ControlLabel>
6262
<FormControl
6363
onChange={this.setInputAccount}
@@ -67,7 +67,7 @@ class Login extends Component {
6767
autoFocus
6868
/>
6969
</FormGroup>
70-
<FormGroup controlId="formHorizontalPassword">
70+
<FormGroup>
7171
<ControlLabel>密码</ControlLabel>
7272
<FormControl
7373
onChange={this.setInputPassword}

‎src/components/Modal/Modal.css

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎src/components/Modal/Modal.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎src/components/Modal/package.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎src/components/ProductList/ProductList.css

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,12 @@
1313
max-width: var(--max-content-width);
1414
}
1515

16-
table {
17-
font-size: 1.1em;
16+
table{
17+
font-size: 1.2em;
1818
width: 100%;
19-
border-collapse: collapse;
20-
color: #666;
21-
margin-top: 20px;
2219
text-align: center;
2320
}
2421

25-
th,
26-
td {
27-
padding: 10px 0;
28-
font-weight: normal;
29-
border: 1px solid #cacaca;
30-
}
31-
32-
th a,
33-
td a {
34-
width: 100%;
35-
color: $main-color;
36-
}
37-
38-
th {
39-
background-color: #eeefff;
40-
}
41-
4222
li {
4323
list-style: none;
4424
}

‎src/components/ProductList/ProductList.js

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import React, { PropTypes, Component } from 'react';
3+
import {Breadcrumb, Table} from 'react-bootstrap';
34
import cx from 'classnames';
45
import _ from 'lodash';
56
import withStyles from 'isomorphic-style-loader/lib/withStyles';
@@ -70,25 +71,31 @@ class ProductList extends Component {
7071
return (
7172
<div className={s.root}>
7273
<div className={s.container}>
73-
<h1>应用列表</h1>
74-
<table>
75-
<tbody>
76-
<tr>
77-
<th width="15%">产品名</th>
78-
<th width="45%">成员</th>
79-
<th width="20%">Deployments</th>
80-
<th width="20%">操作</th>
81-
</tr>
82-
{
83-
this.props.rs.length > 0 ?
84-
_.map(this.props.rs, (item, index) => self.renderRow(item, index))
85-
:
86-
<tr>
87-
<td colSpan="4" >{tipText}</td>
88-
</tr>
89-
}
90-
</tbody>
91-
</table>
74+
<Breadcrumb>
75+
<Breadcrumb.Item active={true}>
76+
应用列表
77+
</Breadcrumb.Item>
78+
</Breadcrumb>
79+
<Table striped bordered condensed hover>
80+
<thead>
81+
<tr>
82+
<th style={{ textAlign:'center' }} >产品名</th>
83+
<th style={{ textAlign:'center' }} >成员</th>
84+
<th style={{ textAlign:'center' }} >Deployments</th>
85+
<th style={{ textAlign:'center' }} >操作</th>
86+
</tr>
87+
</thead>
88+
<tbody>
89+
{
90+
this.props.rs.length > 0 ?
91+
_.map(this.props.rs, (item, index) => self.renderRow(item, index))
92+
:
93+
<tr>
94+
<td colSpan="4" >{tipText}</td>
95+
</tr>
96+
}
97+
</tbody>
98+
</Table>
9299
</div>
93100
</div>
94101
);

‎src/components/Register/NavStep/NavStep.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
.progress li em {
4848
display: inline-block;
4949
width: 28px;
50-
height: 45px;
5150
position: absolute;
5251
top: -1px;
5352
right: -14px;

‎tools/postcss.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = () => ({
1616
require('postcss-partial-import')(),
1717
// Allow you to fix url() according to postcss to and/or from options
1818
// https://github.com/postcss/postcss-url
19-
// require('postcss-url')(),
19+
require('postcss-url')(),
2020
// W3C variables, e.g. :root { --color: red; } div { background: var(--color); }
2121
// https://github.com/postcss/postcss-custom-properties
2222
require('postcss-custom-properties')(),

0 commit comments

Comments
 (0)
This repository has been archived.