SecurityView.js 1.85 KB
Newer Older
陈帅's avatar
陈帅 committed
1
import React, { Component, Fragment } from 'react';
张秀玲's avatar
张秀玲 committed
2
import { FormattedMessage } from 'react-intl';
陈帅's avatar
陈帅 committed
3 4 5
import { List } from 'antd';

const passwordStrength = {
张秀玲's avatar
张秀玲 committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
  strong: (
    <font className="strong">
      <FormattedMessage id="app.settings.security.strong" defaultMessage="Strong" />
    </font>
  ),
  medium: (
    <font className="medium">
      <FormattedMessage id="app.settings.security.medium" defaultMessage="Medium" />
    </font>
  ),
  weak: (
    <font className="weak">
      <FormattedMessage id="app.settings.security.weak" defaultMessage="Weak" />Weak
    </font>
  ),
陈帅's avatar
陈帅 committed
21 22
};

ddcat1115's avatar
ddcat1115 committed
23
export default class SecurityView extends Component {
陈帅's avatar
陈帅 committed
24 25 26
  getData = () => {
    return [
      {
张秀玲's avatar
张秀玲 committed
27 28 29
        title: 'account password',
        description: <Fragment> Current password strength{passwordStrength.strong}</Fragment>,
        actions: [<a>Modify</a>],
陈帅's avatar
陈帅 committed
30 31
      },
      {
张秀玲's avatar
张秀玲 committed
32 33 34
        title: 'Security phone',
        description: 'Bound phone:138****8293',
        actions: [<a>Modify</a>],
陈帅's avatar
陈帅 committed
35 36
      },
      {
张秀玲's avatar
张秀玲 committed
37 38 39 40
        title: 'Security Question',
        description:
          'The security question is not set, and the security policy can effectively protect the account security',
        actions: [<a>Set</a>],
陈帅's avatar
陈帅 committed
41 42
      },
      {
张秀玲's avatar
张秀玲 committed
43 44 45
        title: 'Backup Email',
        description: 'Bound Email:ant***sign.com',
        actions: [<a>Modify</a>],
陈帅's avatar
陈帅 committed
46 47
      },
      {
张秀玲's avatar
张秀玲 committed
48 49 50
        title: 'MFA Device',
        description: 'Unbound MFA device, after binding, can be confirmed twice',
        actions: [<a>Bind</a>],
陈帅's avatar
陈帅 committed
51 52 53
      },
    ];
  };
陈帅's avatar
陈帅 committed
54

陈帅's avatar
陈帅 committed
55 56 57 58 59 60 61 62
  render() {
    return (
      <Fragment>
        <List
          itemLayout="horizontal"
          dataSource={this.getData()}
          renderItem={item => (
            <List.Item actions={item.actions}>
jim's avatar
jim committed
63
              <List.Item.Meta title={item.title} description={item.description} />
陈帅's avatar
陈帅 committed
64 65 66 67 68 69 70
            </List.Item>
          )}
        />
      </Fragment>
    );
  }
}