fix: lose `Monitored` in cluster editing (#123)

Co-authored-by: yaojiping <yaojiping@infini.ltd>
This commit is contained in:
yaojp123 2025-02-13 16:07:26 +08:00 committed by GitHub
parent 304fad0121
commit 2f94f14d79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 11 deletions

View File

@ -68,17 +68,7 @@ class ClusterForm extends React.Component {
]; ];
componentDidMount() { componentDidMount() {
//console.log(this.props.clusterConfig.editMode)
const { match, dispatch, clusterConfig } = this.props; const { match, dispatch, clusterConfig } = this.props;
if (clusterConfig?.editValue) {
this.setState({
monitored: clusterConfig?.editValue.hasOwnProperty("monitored")
? clusterConfig?.editValue?.monitored
: false,
});
}
dispatch({ dispatch({
type: "clusterConfig/fetchCluster", type: "clusterConfig/fetchCluster",
payload: { payload: {
@ -107,7 +97,8 @@ class ClusterForm extends React.Component {
this.setState({ this.setState({
needAuth, needAuth,
isManual, isManual,
collectMode collectMode,
monitored: editValue?.hasOwnProperty("monitored") ? editValue?.monitored : false,
}); });
} }
}); });