完善私钥验证
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -1,12 +1,13 @@
|
||||
import React, {Component} from 'react';
|
||||
import {Button, Card, Checkbox, Form, Input} from "antd";
|
||||
import {Button, Card, Checkbox, Form, Input, Typography} from "antd";
|
||||
import './Login.css'
|
||||
import request from "../common/request";
|
||||
import {message} from "antd/es";
|
||||
import {withRouter} from "react-router-dom";
|
||||
import {
|
||||
UserOutlined, LockOutlined
|
||||
} from '@ant-design/icons';
|
||||
import {LockOutlined, UserOutlined} from '@ant-design/icons';
|
||||
|
||||
|
||||
const {Title} = Typography;
|
||||
|
||||
class LoginForm extends Component {
|
||||
|
||||
@ -48,9 +49,12 @@ class LoginForm extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
<Card className='login-card' title="登录">
|
||||
<div className='login-bg' style={{width: window.innerWidth, height: window.innerHeight, backgroundColor: '#F0F2F5'}}>
|
||||
<Card className='login-card' title={null}>
|
||||
<div style={{textAlign: "center", margin: '15px auto 30px auto', color: '#1890ff'}}>
|
||||
<Title level={1}>Next Terminal</Title>
|
||||
</div>
|
||||
<Form onFinish={this.handleSubmit} className="login-form">
|
||||
<Form.Item name='username' rules={[{required: true, message: '请输入登录账号!'}]}>
|
||||
<Input prefix={<UserOutlined/>} placeholder="登录账号"/>
|
||||
@ -71,6 +75,8 @@ class LoginForm extends Component {
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -766,12 +766,12 @@ class Access extends Component {
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
<div className="container" style={{
|
||||
overflow: this.state.containerOverflow,
|
||||
width: this.state.containerWidth,
|
||||
height: this.state.containerHeight
|
||||
}}>
|
||||
|
||||
<div id="display"/>
|
||||
</div>
|
||||
|
||||
|
@ -17,6 +17,14 @@ const AssetModal = function ({title, visible, handleOk, handleCancel, confirmLoa
|
||||
setAccountType(model.accountType);
|
||||
});
|
||||
|
||||
for (let key in model) {
|
||||
if (model.hasOwnProperty(key)) {
|
||||
if (model[key] === '-') {
|
||||
model[key] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const formItemLayout = {
|
||||
labelCol: {span: 6},
|
||||
wrapperCol: {span: 14},
|
||||
@ -54,7 +62,7 @@ const AssetModal = function ({title, visible, handleOk, handleCancel, confirmLoa
|
||||
<Modal
|
||||
title={title}
|
||||
visible={visible}
|
||||
maskClosable={true}
|
||||
maskClosable={false}
|
||||
onOk={() => {
|
||||
form
|
||||
.validateFields()
|
||||
@ -62,7 +70,8 @@ const AssetModal = function ({title, visible, handleOk, handleCancel, confirmLoa
|
||||
form.resetFields();
|
||||
handleOk(values);
|
||||
})
|
||||
.catch(info => {});
|
||||
.catch(info => {
|
||||
});
|
||||
}}
|
||||
onCancel={handleCancel}
|
||||
confirmLoading={confirmLoading}
|
||||
@ -103,7 +112,7 @@ const AssetModal = function ({title, visible, handleOk, handleCancel, confirmLoa
|
||||
}}>
|
||||
<Option value="custom">自定义</Option>
|
||||
<Option value="credential">授权凭证</Option>
|
||||
<Option value="secret-key">密钥</Option>
|
||||
<Option value="private-key">私钥</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
@ -143,10 +152,17 @@ const AssetModal = function ({title, visible, handleOk, handleCancel, confirmLoa
|
||||
}
|
||||
|
||||
{
|
||||
accountType === 'secret-key' ?
|
||||
<Form.Item label="私钥" name='passphrase' rules={[{required: true, message: '请输入私钥'}]}>
|
||||
<TextArea rows={4}/>
|
||||
</Form.Item>
|
||||
accountType === 'private-key' ?
|
||||
<>
|
||||
<Form.Item label="私钥" name='privateKey' rules={[{required: true, message: '请输入私钥'}]}>
|
||||
<TextArea rows={4}/>
|
||||
</Form.Item>
|
||||
<Form.Item label="私钥密码" name='passphrase'>
|
||||
<TextArea rows={1}/>
|
||||
</Form.Item>
|
||||
</>
|
||||
|
||||
|
||||
: null
|
||||
}
|
||||
</Form>
|
||||
|
@ -481,12 +481,14 @@ class OfflineSession extends Component {
|
||||
|
||||
<Modal
|
||||
title="会话回放"
|
||||
centered
|
||||
visible={this.state.playbackVisible}
|
||||
onCancel={this.hidePlayback}
|
||||
|
||||
width={window.innerWidth * 0.8}
|
||||
footer={null}
|
||||
destroyOnClose
|
||||
maskClosable={false}
|
||||
>
|
||||
<Playback sessionId={this.state.playbackSessionId}/>
|
||||
</Modal>
|
||||
|
@ -477,6 +477,7 @@ class OnlineSession extends Component {
|
||||
className='monitor'
|
||||
title={this.state.sessionTitle}
|
||||
centered
|
||||
maskClosable={false}
|
||||
visible={this.state.accessVisible}
|
||||
footer={null}
|
||||
width={window.innerWidth * 0.8}
|
||||
|
Reference in New Issue
Block a user