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.

0 commit comments

Comments
 (0)
This repository has been archived.