Unverified Commit fa3a70ad authored by wellCh4n's avatar wellCh4n Committed by GitHub

[Fix][admin] Fix cluster configuration form cannot input. (#1449)

parent 7fa6cac8
......@@ -69,6 +69,11 @@ const ClusterForm: React.FC<ClusterFormProps> = (props) => {
handleSubmit(fieldsValue);
};
const onModalCancel = () => {
handleModalVisible(false);
form.resetFields();
};
const renderContent = (formValsPara: Partial<ClusterTableListItem>) => {
form.resetFields();
return (
......@@ -152,7 +157,7 @@ const ClusterForm: React.FC<ClusterFormProps> = (props) => {
const renderFooter = () => {
return (
<>
<Button onClick={() => handleModalVisible(false)}>{l('button.cancel')}</Button>
<Button onClick={() => onModalCancel()}>{l('button.cancel')}</Button>
<Button type="primary" onClick={() => submitForm()}>
{l('button.finish')}
</Button>
......@@ -168,7 +173,7 @@ const ClusterForm: React.FC<ClusterFormProps> = (props) => {
title={formVals.id ? l('pages.rc.cluster.modify') : l('pages.rc.cluster.create')}
visible={modalVisible}
footer={renderFooter()}
onCancel={() => handleModalVisible()}
onCancel={() => onModalCancel()}
>
<Form
{...formLayout}
......
......@@ -76,6 +76,11 @@ const ClusterConfigurationForm: React.FC<ClusterConfigurationFormProps> = (props
setFlinkConfigPath(all['flinkConfigPath']);
};
const onModalCancel = () => {
handleModalVisible(false);
form.resetFields();
};
const buildConfig = (config: Config[], formValsPara: any) => {
const itemList: JSX.Element[] = [];
config.forEach(configItem => {
......@@ -289,7 +294,6 @@ const ClusterConfigurationForm: React.FC<ClusterConfigurationFormProps> = (props
}
const renderContent = (formValsPara: Partial<ClusterConfigurationTableListItem>) => {
form.resetFields();
return (
<>
<Form.Item
......@@ -363,7 +367,7 @@ const ClusterConfigurationForm: React.FC<ClusterConfigurationFormProps> = (props
const renderFooter = () => {
return (
<>
<Button onClick={() => handleModalVisible(false)}>{l('button.cancel')}</Button>
<Button onClick={() => onModalCancel()}>{l('button.cancel')}</Button>
<Button type="primary" htmlType="button" onClick={testForm}>{l('button.test')}</Button>
<Button type="primary" onClick={() => submitForm()}>{l('button.finish')}</Button>
</>
......@@ -378,7 +382,7 @@ const ClusterConfigurationForm: React.FC<ClusterConfigurationFormProps> = (props
title={formVals.id ? l('pages.rc.clusterConfig.modify') : l('pages.rc.clusterConfig.create')}
visible={modalVisible}
footer={renderFooter()}
onCancel={() => handleModalVisible()}
onCancel={() => onModalCancel()}
>
<Form
{...formLayout}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment