|
|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import React, { useState, forwardRef, useImperativeHandle, useEffect } from 'react';
|
|
|
|
|
import { Form, Grid, Input, Message, Select } from '@arco-design/web-react';
|
|
|
|
|
import { Form, Grid, Input, Message, Select, InputNumber } from '@arco-design/web-react';
|
|
|
|
|
import { submitEnvConfig } from '@/api/componentDeployEnv';
|
|
|
|
|
|
|
|
|
|
const FormItem = Form.Item;
|
|
|
|
|
@ -85,6 +85,10 @@ const FormEditor = forwardRef<FormEditorInstance, FormEditorProps>(({
|
|
|
|
|
if (!value) {
|
|
|
|
|
return cb('请输入环境IP');
|
|
|
|
|
}
|
|
|
|
|
const ipRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
|
|
|
|
if (!ipRegex.test(value)) {
|
|
|
|
|
return cb('请输入正确的IP地址:范围在0.0.0.0-255.255.255.255之间');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return cb();
|
|
|
|
|
}
|
|
|
|
|
@ -101,11 +105,16 @@ const FormEditor = forwardRef<FormEditorInstance, FormEditorProps>(({
|
|
|
|
|
return cb('请输入docker端口');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const portRegex = /^(?:[1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/;
|
|
|
|
|
if (!portRegex.test(value)) {
|
|
|
|
|
return cb('docker端口只能是1-65535之间');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return cb();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]}>
|
|
|
|
|
<Input style={{ width: '90%' }} allowClear placeholder="请输入docker端口" />
|
|
|
|
|
<InputNumber style={{ width: '90%' }} placeholder="请输入docker端口" />
|
|
|
|
|
</FormItem>
|
|
|
|
|
</Grid.Col>
|
|
|
|
|
</Grid.Row>
|
|
|
|
|
|