修改docker默认时区为上海
修复了记住登录无效的问题 修复了ssh下载文件名称不正确的问题 授权凭证增加了密钥类型
This commit is contained in:
@ -1,7 +1,15 @@
|
||||
import React from 'react';
|
||||
import {Form, Input, Modal} from "antd/lib/index";
|
||||
import React, {useState} from 'react';
|
||||
import {Form, Input, Modal, Select} from "antd/lib/index";
|
||||
import {isEmpty} from "../../utils/utils";
|
||||
|
||||
const CredentialModal = ({title, visible, handleOk, handleCancel, confirmLoading,model}) => {
|
||||
const {TextArea} = Input;
|
||||
|
||||
const accountTypes = [
|
||||
{text: '密码', value: 'custom'},
|
||||
{text: '密钥', value: 'private-key'},
|
||||
];
|
||||
|
||||
const CredentialModal = ({title, visible, handleOk, handleCancel, confirmLoading, model}) => {
|
||||
|
||||
const [form] = Form.useForm();
|
||||
|
||||
@ -10,6 +18,29 @@ const CredentialModal = ({title, visible, handleOk, handleCancel, confirmLoading
|
||||
wrapperCol: {span: 14},
|
||||
};
|
||||
|
||||
if (model === null || model === undefined) {
|
||||
model = {}
|
||||
}
|
||||
|
||||
if (isEmpty(model.type)) {
|
||||
model.type = 'custom';
|
||||
}
|
||||
|
||||
for (let key in model) {
|
||||
if (model.hasOwnProperty(key)) {
|
||||
if (model[key] === '-') {
|
||||
model[key] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let [type, setType] = useState(model.type);
|
||||
|
||||
const handleAccountTypeChange = v => {
|
||||
setType(v);
|
||||
model.type = v;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
<Modal
|
||||
@ -43,13 +74,40 @@ const CredentialModal = ({title, visible, handleOk, handleCancel, confirmLoading
|
||||
<Input placeholder="请输入凭证名称"/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="授权账户" name='username' rules={[{required: true, message: '请输入授权账户'}]}>
|
||||
<Input placeholder="输入授权账户"/>
|
||||
<Form.Item label="账户类型" name='type' rules={[{required: true, message: '请选择接账户类型'}]}>
|
||||
<Select onChange={handleAccountTypeChange}>
|
||||
{accountTypes.map(item => {
|
||||
return (<Select.Option key={item.value} value={item.value}>{item.text}</Select.Option>)
|
||||
})}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="授权密码" name='password' rules={[{required: true, message: '请输入授权密码',}]}>
|
||||
<Input placeholder="输入授权密码"/>
|
||||
</Form.Item>
|
||||
{
|
||||
type === 'private-key' ?
|
||||
<>
|
||||
<Form.Item label="授权账户" name='username'>
|
||||
<Input placeholder="输入授权账户"/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="私钥" name='privateKey' rules={[{required: true, message: '请输入私钥'}]}>
|
||||
<TextArea rows={4}/>
|
||||
</Form.Item>
|
||||
<Form.Item label="私钥密码" name='passphrase'>
|
||||
<TextArea rows={1}/>
|
||||
</Form.Item>
|
||||
</>
|
||||
:
|
||||
<>
|
||||
<Form.Item label="授权账户" name='username'>
|
||||
<Input placeholder="输入授权账户"/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="授权密码" name='password'>
|
||||
<Input placeholder="输入授权密码"/>
|
||||
</Form.Item>
|
||||
</>
|
||||
|
||||
}
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user