init local state from global state

This commit is contained in:
medcl 2021-03-06 15:17:39 +08:00
parent 7a8651bf1e
commit 73d17ebebf
1 changed files with 4 additions and 1 deletions

View File

@ -166,7 +166,6 @@ class ClusterMonitor extends PureComponent {
qsVisible: false,
}
componentWillReceiveProps(newProps) {
}
@ -254,6 +253,9 @@ class ClusterMonitor extends PureComponent {
id: queryESID
}
})
}else if (this.props.selectedCluster.id!==undefined&&this.props.selectedCluster.id!==null){
this.setState({ clusterID:this.props.selectedCluster.id }, () => {
});
}else{
//alert("cluster ID is not set");
return
@ -305,6 +307,7 @@ class ClusterMonitor extends PureComponent {
this.fetchData();
});
}
onTimeChange = (values) => {
this.setState({
pickerValue: values,