fix: closes #362

This commit is contained in:
王彦民 2018-12-05 22:02:02 +08:00 committed by Asa
parent 91dca4a3b9
commit 2ef2e5a5c6

View File

@ -74,14 +74,14 @@ class InstanceTable extends React.Component {
switchState(index, record) {
const { instance } = this.state;
const { ip, port, weight, enabled } = record;
const { ip, port, weight, enabled, metadata } = record;
const { clusterName, serviceName } = this.props;
const newVal = Object.assign({}, instance);
newVal.list[index].enabled = !enabled;
request({
method: 'POST',
url: 'v1/ns/instance/update',
data: { serviceName, clusterName, ip, port, weight, enable: !enabled },
data: { serviceName, clusterName, ip, port, weight, enable: !enabled, metadata },
dataType: 'text',
beforeSend: () => this.openLoading(),
success: () => this.setState({ instance: newVal }),