Skip to content

Commit

Permalink
fix: Failed to add a node (#1362)
Browse files Browse the repository at this point in the history
Co-authored-by: songyg <[email protected]>
  • Loading branch information
RainBondsongyg and songyg authored Jul 18, 2024
1 parent 2459aec commit 1715673
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
{
antd: true,
dva: {
hmr: true
hmr: false
},
dynamicImport: {
loadingComponent: './components/PageLoading/index',
Expand Down
16 changes: 8 additions & 8 deletions src/components/Cluster/RKEClusterAdd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export default class RKEClusterConfig extends PureComponent {
});
};
fetchRkeconfig = (obj = {}, isNext, fieldsValue = {}) => {
const { form, eid } = this.props;
const { form, eid, clusterID } = this.props;
const { activeKey } = this.state;
const { setFieldsValue } = form;
const info = Object.assign({}, obj, { enterprise_id: eid });
Expand Down Expand Up @@ -379,7 +379,11 @@ export default class RKEClusterConfig extends PureComponent {
notification.warning({ message: helpError });
}
if (isNext && !helpError) {
this.handleStartCheck(isNext, fieldsValue, val)
if(clusterID){
this.updateCluster(val);
} else {
this.handleStartCheck(isNext, fieldsValue, val)
}
}
}
})
Expand All @@ -406,7 +410,7 @@ export default class RKEClusterConfig extends PureComponent {
});
};

updateCluster = () => {
updateCluster = (val) => {
const { dispatch, eid, clusterID, form } = this.props;
const { dataSource, yamlVal } = this.state;
if (dataSource && dataSource.length === 0) {
Expand All @@ -421,7 +425,7 @@ export default class RKEClusterConfig extends PureComponent {
enterprise_id: eid,
clusterID,
provider: 'rke',
encodedRKEConfig: this.encodeBase64Content(values.yamls || yamlVal)
encodedRKEConfig: this.encodeBase64Content(val)
},
callback: data => {
this.handleOk(data && data.response_data);
Expand All @@ -437,10 +441,6 @@ export default class RKEClusterConfig extends PureComponent {
createCluster = () => {
const { form, dispatch, eid, clusterID } = this.props;
const { dataSource, yamlVal } = this.state;
if (clusterID) {
this.updateCluster();
return null;
}
form.validateFields((err, fieldsValue) => {
if (!err) {

Expand Down

0 comments on commit 1715673

Please sign in to comment.